Add a couple header files, add some mips_to_c of some previously un-decomped functions (#132)

* Add a couple header files

These files contain function prototypes for matches functions, NON_MATCHING functions,
 and functions used by matched functions.

At this point in time those headers may contain prototypes for functions defined in
 unrelated files, but fixing that will have take time

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-01-04 21:57:16 -05:00
committed by GitHub
parent c3def3e91f
commit d6cbf56537
11 changed files with 952 additions and 229 deletions
+618 -18
View File
@@ -1,9 +1,8 @@
#include <ultra64.h>
#include <macros.h>
#include <defines.h>
extern u32 func_802B5224(void);
extern s32 gIsMirrorMode;
#include "code_80005FD0.h"
#include "variables.h"
s16 func_80005FD0(void) {
s16 temp_ret;
@@ -10739,12 +10738,248 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800162CC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function func_80016494:
//generated by mips_to_c commit 5bd751fca3befef73d6a2e20d84a88cc918a77fe
s32 func_80007BF8(s32, s32, ?, ?, s32); /* extern */
? func_8000BBD8(u16, f32, s16, u16, s16, s16); /* extern */
s16 func_8000D33C(f32, f32, s32, f32, s16, s32); /* extern */
? func_80014D30(s32, s32); /* extern */
? func_8001A348(s32, f32, s16, ?, ?); /* extern */
f32 func_802AE1C0(f32, f32, f32, f32 *); /* extern */
s16 func_802B7830(f32, f32); /* extern */
f32 sqrtf(f32, f32, s32); /* extern */
extern ? D_80162FA0;
extern ? D_80163068;
extern s32 D_80163238;
extern ? D_80164438;
extern ? D_80164550;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
extern s32 gPlayerOne;
Gap in callee-saved word stack region. Saved: [(32, 4), (36, 4), (76, 4)], gap at: 76 != 40.
*/
void func_80016494(void *arg0, u16 *arg1, s8 arg2, s32 arg3) {
s16 spB6;
s16 spB4;
f32 spAC;
f32 spA8;
f32 spA4;
void *spA0;
s32 sp9C;
f32 sp98;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp88;
f32 sp84;
s16 sp7A;
u16 sp78;
s32 sp68;
f32 sp64;
s32 sp5C;
f32 *sp58;
f32 *sp54;
s32 sp50; /* compiler-managed */
s32 sp4C; /* compiler-managed */
s32 sp48;
s16 *sp44;
f32 *sp40;
f32 *sp3C;
u16 *sp38;
f64 sp28;
f32 *temp_a3;
f32 *temp_t0_2;
f32 *temp_t1_2;
f32 *temp_t1_3;
f32 *temp_t4;
f32 *temp_t5;
f32 *temp_t5_2;
f32 temp_f0_3;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f16;
f32 temp_f18;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
f32 temp_f4;
f32 temp_f6;
f32 temp_f6_2;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f16_2;
f64 temp_f2_6;
s16 *temp_t1;
s16 temp_t2;
s16 temp_t3_2;
s16 temp_v0_2;
s16 temp_v1;
s32 temp_a1;
s32 temp_hi;
s32 temp_ra;
s32 temp_t0;
s32 temp_v0;
s32 temp_v0_3;
u16 *temp_t7;
u16 temp_t3;
u16 temp_v1_2;
f64 phi_f0;
u16 phi_f12;
f32 phi_f18;
temp_a1 = arg3 * 4;
temp_t5 = temp_a1 + &D_80164648;
temp_t4 = temp_a1 + &D_80164658;
temp_f2 = *temp_t5;
temp_v1 = arg0->unkAE;
*temp_t5 = temp_f2 + ((*temp_t4 - temp_f2) * 0.5f);
D_80163238 = (s32) temp_v1;
temp_t0 = temp_v1 * 2;
temp_t3 = *(&D_801645B0 + temp_t0);
temp_ra = temp_v1 * 0xDD8;
temp_v0 = arg3 * 2;
temp_t1 = temp_v0 + &D_80164668;
sp4C = temp_ra;
spA0 = gPlayerOne + temp_ra;
sp44 = temp_t1;
sp48 = temp_v0;
sp50 = temp_t0;
sp58 = temp_t5;
sp54 = temp_t4;
sp5C = temp_a1;
sp9C = (s32) temp_v1;
sp68 = (s32) temp_t3;
*sp44 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, *temp_t1, (s32) temp_t3);
temp_t1_2 = (temp_v1 * 4) + &D_80163068;
temp_t5_2 = sp5C + &D_80164688;
temp_f2_2 = *temp_t1_2 - *temp_t5_2;
temp_t3_2 = *sp44;
temp_t7 = (sp68 * 2) + &D_801645C8;
temp_f2_3 = temp_f2_2 * temp_f2_2;
sp38 = temp_t7;
temp_t2 = *(&D_80164438 + temp_t0);
sp3C = temp_t5_2;
sp64 = temp_f2_3;
sp40 = temp_t1_2;
spB6 = temp_t3_2;
spB4 = temp_t2;
if (func_80007BF8(temp_t2 & 0xFFFF, temp_t3_2 & 0xFFFF, 0xF, 0xF, (s32) *temp_t7) <= 0) {
sp3C = temp_t5_2;
func_8001A348(arg3, *temp_t5_2, *(&D_80164680 + sp48));
phi_f12 = (bitwise u16) *temp_t5_2;
} else {
temp_f0 = (f64) *temp_t1_2;
if ((temp_f0 < 0.0) && ((f64) *temp_t5_2 < 0.0) && ((f64) temp_f2_3 < 0.01)) {
sp3C = temp_t5_2;
func_8001A348(arg3, 1.0f, 5);
phi_f12 = (bitwise u16) *temp_t5_2;
} else {
temp_f12 = *temp_t5_2;
phi_f12 = (bitwise u16) temp_f12;
if ((temp_f0 > 0.0) && ((f64) temp_f12 > 0.0) && ((f64) temp_f2_3 < 0.01)) {
sp3C = temp_t5_2;
func_8001A348((bitwise s32) temp_f12, 0.0f, (s16) arg3, 0xBF800000, 4);
phi_f12 = (bitwise u16) *temp_t5_2;
} else {
if (((s32) temp_t3_2 < (s32) temp_t2) && ((temp_t2 - temp_t3_2) < 0xA)) {
*temp_t4 = (f32) ((f64) *(&gPlayers->unk_094 + temp_ra) + 0.4);
}
if (((s32) temp_t2 < (s32) temp_t3_2) && ((temp_t3_2 - temp_t2) < 0xA)) {
*temp_t4 = (f32) ((f64) *(&gPlayers->unk_094 + temp_ra) - 0.4);
}
temp_f0_2 = (f64) *temp_t4;
phi_f0 = temp_f0_2;
if (temp_f0_2 > 10.0) {
*temp_t4 = 10.0f;
phi_f0 = (f64) *temp_t4;
}
if (phi_f0 < 0.0) {
*temp_t4 = 0.0f;
}
}
}
}
temp_v1_2 = *sp38;
temp_v0_2 = *sp44;
sp3C = sp5C + &D_80164688;
temp_hi = (s32) (temp_v0_2 + 1) % (s32) temp_v1_2;
sp78 = (u16) ((s32) (temp_v0_2 + 2) % (s32) temp_v1_2);
sp7A = (s16) temp_hi;
sp54 = (f32 *) unksp6A;
func_8000BBD8(phi_f12, 0.0f, (s16) temp_hi & 0xFFFF, phi_f12, unksp6A, (s16) temp_hi);
temp_f6 = (f32) ((f64) D_80162FA0.unk0 * 0.5);
sp98 = temp_f6;
temp_f18 = (f32) ((f64) D_80162FA0.unk8 * 0.5);
sp90 = temp_f18;
func_8000BBD8(sp78, *(sp5C + &D_80164688), unksp6A);
temp_v0_3 = *(&D_80164550 + (sp68 * 4));
temp_f4 = (f32) ((f64) temp_f6 + ((f64) D_80162FA0.unk0 * 0.5));
sp98 = temp_f4;
temp_a3 = sp5C + &D_801645F8;
temp_t0_2 = sp5C + &D_80164618;
temp_t1_3 = sp5C + &D_80164638;
sp4C = temp_t1_3;
sp50 = temp_t0_2;
sp54 = temp_a3;
temp_f14 = temp_f4 - *temp_a3;
temp_f6_2 = (f32) ((f64) ((temp_v0_3 + ((s16) sp78 * 8))->unk2 + (temp_v0_3 + (sp7A * 8))->unk2) * 0.5);
temp_f2_4 = (f32) ((f64) temp_f18 + ((f64) D_80162FA0.unk8 * 0.5)) - *temp_t1_3;
sp94 = temp_f6_2;
sp8C = temp_f14;
temp_f16 = temp_f6_2 - *temp_t0_2;
sp84 = temp_f2_4;
sp88 = temp_f16;
temp_f0_3 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f2_4 * temp_f2_4), temp_f14, sp5C);
if ((f64) temp_f0_3 != 0.0) {
temp_f2_5 = *sp58;
sp98 = ((temp_f2_5 * temp_f14) / temp_f0_3) + *temp_a3;
sp94 = ((temp_f2_5 * temp_f16) / temp_f0_3) + *temp_t0_2;
phi_f18 = ((temp_f2_5 * sp84) / temp_f0_3) + *temp_t1_3;
} else {
sp98 = *temp_a3;
sp94 = *temp_t0_2;
phi_f18 = *temp_t1_3;
}
arg0->unk8 = phi_f18;
arg0->unk0 = sp98;
temp_f16_2 = (f64) sp94;
sp28 = temp_f16_2;
sp90 = phi_f18;
sp4C = temp_t1_3;
sp50 = temp_t0_2;
sp54 = temp_a3;
temp_f2_6 = (f64) func_802AE1C0(sp98, (f32) (temp_f16_2 + 30.0), phi_f18, temp_a3);
if ((temp_f2_6 < (temp_f16_2 - 20.0)) || (temp_f2_6 >= 3000.0)) {
arg0->unk4 = (f32) (temp_f16_2 + 10.0);
} else {
arg0->unk4 = (f32) (temp_f2_6 + 10.0);
}
*temp_t1_3 = phi_f18;
*temp_a3 = sp98;
*temp_t0_2 = sp94;
arg0->unkC = (f32) spA0->unk14;
arg0->unk10 = (f32) ((f64) spA0->unk18 + 6.0);
arg0->unk14 = (f32) spA0->unk1C;
func_80014D30(arg3, sp68);
temp_f12_2 = arg0->unkC - arg0->unk0;
spA8 = arg0->unk10 - arg0->unk4;
spAC = temp_f12_2;
temp_f14_2 = arg0->unk14 - arg0->unk8;
spA4 = temp_f14_2;
arg0->unk26 = func_802B7830(temp_f12_2, temp_f14_2);
arg0->unk24 = func_802B7830(sqrtf((spAC * spAC) + (temp_f14_2 * temp_f14_2), temp_f14_2), spA8);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80016494.s")
#endif
@@ -11100,12 +11335,192 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80017720.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function func_800178F4:
//generated by mips_to_c commit 5bd751fca3befef73d6a2e20d84a88cc918a77fe
s32 func_80007BF8(s32, s32, ?, ?, s32); /* extern */
? func_8000BBD8(u16, f32, s16, s32); /* extern */
s16 func_8000D33C(f32, f32, f32 *, f32, s16, s32); /* extern */
? func_80014D30(s32, s32, f32 *, f32 *); /* extern */
? func_8001A348(s32, f32, s16); /* extern */
s16 func_802B7830(f32, f32); /* extern */
f32 sqrtf(f32, f32, f32 *, f32 *); /* extern */
extern ? D_80162FA0;
extern ? D_80163068;
extern s32 D_80163238;
extern ? D_80164438;
extern ? D_80164550;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
extern s32 gPlayerOne;
Gap in callee-saved word stack region. Saved: [(32, 4), (36, 4), (80, 4)], gap at: 80 != 40.
*/
void func_800178F4(void *arg0, u16 *arg1, s8 arg2, s32 arg3) {
s16 sp9E;
s16 sp9C;
f32 sp94;
f32 sp90;
f32 sp8C;
void *sp88;
f32 sp80;
f32 sp78;
f32 sp74;
f32 sp70;
f32 sp6C;
s16 sp62;
u16 sp60;
s32 sp50;
s32 sp4C;
s32 sp44;
f32 *sp40;
f32 *sp3C;
f32 *sp38;
s32 sp34; /* compiler-managed */
s32 sp30;
s32 sp2C;
s16 *sp28;
f32 *temp_a1;
f32 *temp_a2;
f32 *temp_a3;
f32 *temp_t6;
f32 *temp_v1;
f32 *temp_v1_2;
f32 temp_f0_2;
f32 temp_f12;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f16_3;
f32 temp_f2;
f64 temp_f0;
s16 *temp_t1;
s16 temp_t1_2;
s16 temp_v0;
s16 temp_v0_2;
s32 temp_hi;
s32 temp_hi_2;
s32 temp_t2;
s32 temp_t3;
s32 temp_t4;
s32 temp_t8;
s32 temp_v0_3;
u16 temp_ra;
f64 phi_f0;
f32 phi_f2;
f32 phi_f14;
f32 phi_f18;
temp_v0 = arg0->unkAE;
temp_t4 = arg3 * 4;
temp_a1 = temp_t4 + &D_80164688;
temp_t6 = temp_t4 + &D_80164648;
sp3C = temp_t6;
temp_v1 = temp_t4 + &D_80164658;
*temp_a1 = *(&D_80163068 + (temp_v0 * 4));
temp_f16 = *temp_t6;
temp_t2 = temp_v0 * 2;
temp_t3 = temp_v0 * 0xDD8;
*temp_t6 = temp_f16 + ((*temp_v1 - temp_f16) * 0.5f);
temp_ra = *(&D_801645B0 + temp_t2);
D_80163238 = (s32) temp_v0;
sp4C = (s32) *(&D_801645C8 + (temp_ra * 2));
temp_t8 = arg3 * 2;
temp_t1 = temp_t8 + &D_80164668;
sp50 = (s32) temp_ra;
sp88 = gPlayerOne + temp_t3;
sp28 = temp_t1;
sp2C = temp_t8;
sp44 = temp_t4;
sp30 = temp_t3;
sp34 = temp_t2;
sp40 = temp_a1;
sp38 = temp_v1;
*sp28 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, *temp_t1, (s32) temp_ra);
temp_t1_2 = *sp28;
temp_hi = (s32) (*(&D_80164438 + temp_t2) + 3) % sp4C;
sp9C = (s16) temp_hi;
sp9E = temp_t1_2;
if (func_80007BF8(temp_hi & 0xFFFF, temp_t1_2 & 0xFFFF, 0xD, 1, sp4C) <= 0) {
sp44 = temp_t4;
func_8001A348(arg3, *sp40, *(&D_80164680 + sp2C));
} else {
if (((s32) temp_t1_2 < (s32) sp9C) && ((sp9C - temp_t1_2) < 3)) {
*temp_v1 = (f32) ((f64) *(&gPlayers->unk_094 + temp_t3) + 0.1);
}
if (((s32) sp9C < (s32) temp_t1_2) && ((temp_t1_2 - sp9C) < 3)) {
*temp_v1 = (f32) ((f64) *(&gPlayers->unk_094 + temp_t3) - 0.1);
}
temp_f0 = (f64) *temp_v1;
phi_f0 = temp_f0;
if (temp_f0 > 10.0) {
*temp_v1 = 10.0f;
phi_f0 = (f64) *temp_v1;
}
if (phi_f0 < 0.0) {
*temp_v1 = 0.0f;
}
}
temp_v0_2 = *sp28;
temp_hi_2 = (s32) (temp_v0_2 + 1) % sp4C;
sp60 = (u16) ((s32) (temp_v0_2 + 2) % sp4C);
sp62 = (s16) temp_hi_2;
sp44 = arg3 * 4;
sp38 = (f32 *) unksp52;
func_8000BBD8((s16) temp_hi_2 & 0xFFFF, *sp40, unksp52, sp4C);
temp_f2 = (f32) ((f64) D_80162FA0.unk0 * 0.5);
temp_f14 = (f32) ((f64) D_80162FA0.unk8 * 0.5);
sp80 = temp_f2;
sp78 = temp_f14;
func_8000BBD8(sp60, *sp40, unksp52);
temp_v0_3 = *(&D_80164550 + (sp50 * 4));
temp_a2 = (arg3 * 4) + &D_80164618;
temp_f14_2 = (f32) ((f64) temp_f14 + ((f64) D_80162FA0.unk8 * 0.5));
temp_v1_2 = (arg3 * 4) + &D_801645F8;
temp_a3 = (arg3 * 4) + &D_80164638;
temp_f16_2 = (f32) ((f64) temp_f2 + ((f64) D_80162FA0.unk0 * 0.5)) - *temp_v1_2;
sp34 = temp_a3;
sp40 = temp_v1_2;
sp74 = temp_f16_2;
sp38 = temp_a2;
sp70 = (f32) ((f64) ((temp_v0_3 + ((s16) sp60 * 8))->unk2 + (temp_v0_3 + (sp62 * 8))->unk2) * 0.5) - *temp_a2;
sp6C = temp_f14_2 - *temp_a3;
temp_f0_2 = sqrtf((temp_f16_2 * temp_f16_2) + (sp70 * sp70) + (sp6C * sp6C), temp_f14_2, temp_a2, temp_a3);
if ((f64) temp_f0_2 != 0.0) {
temp_f16_3 = *sp3C;
phi_f2 = ((temp_f16_3 * sp74) / temp_f0_2) + *temp_v1_2;
phi_f14 = ((temp_f16_3 * sp6C) / temp_f0_2) + *temp_a3;
phi_f18 = ((temp_f16_3 * sp70) / temp_f0_2) + *temp_a2;
} else {
phi_f2 = *temp_v1_2;
phi_f14 = *temp_a3;
phi_f18 = *temp_a2;
}
arg0->unk0 = phi_f2;
arg0->unk8 = phi_f14;
arg0->unk4 = (f32) ((f64) phi_f18 + 10.0);
*temp_v1_2 = phi_f2;
*temp_a2 = phi_f18;
*temp_a3 = phi_f14;
arg0->unkC = (f32) sp88->unk14;
arg0->unk10 = (f32) ((f64) sp88->unk18 + 6.0);
arg0->unk14 = (f32) sp88->unk1C;
func_80014D30(arg3, sp50, temp_a2, temp_a3);
temp_f12 = arg0->unkC - arg0->unk0;
sp90 = arg0->unk10 - arg0->unk4;
sp94 = temp_f12;
temp_f14_3 = arg0->unk14 - arg0->unk8;
sp8C = temp_f14_3;
arg0->unk26 = func_802B7830(temp_f12, temp_f14_3);
arg0->unk24 = func_802B7830(sqrtf((sp94 * sp94) + (temp_f14_3 * temp_f14_3), temp_f14_3), sp90);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800178F4.s")
#endif
@@ -11176,12 +11591,197 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80017F10.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function func_800180F0:
//generated by mips_to_c commit 5bd751fca3befef73d6a2e20d84a88cc918a77fe
s32 func_80007BF8(s32, s32, ?, ?, s32); /* extern */
? func_8000BBD8(u16, f32, s16); /* extern */
s16 func_8000D33C(f32, f32, f32 *, f32, s16, s32); /* extern */
? func_80014D30(s32, s32, f32 *, f32 *); /* extern */
? func_8001A348(s32, f32, s16); /* extern */
s16 func_802B7830(f32, f32); /* extern */
f32 sqrtf(f32, f32, f32 *, f32 *); /* extern */
extern ? D_80162FA0;
extern ? D_80163068;
extern s32 D_80163238;
extern ? D_80164438;
extern ? D_80164550;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
extern s32 gPlayerOne;
Gap in callee-saved word stack region. Saved: [(16, 4), (28, 4), (32, 4), (36, 4)], gap at: 28 != 20.
*/
void func_800180F0(void *arg0, u16 *arg1, s8 arg2, s32 arg3) {
s16 sp9E;
s16 sp9C;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp80;
f32 sp78;
f32 sp74;
f32 sp70;
f32 sp6C;
s16 sp62;
u16 sp60;
s32 sp50;
s32 sp4C;
s32 sp44;
f32 *sp40;
f32 *sp3C;
f32 *sp38;
s32 sp34; /* compiler-managed */
s32 sp30;
s32 sp2C;
s16 *sp28;
f32 *temp_a1;
f32 *temp_a2;
f32 *temp_a3;
f32 *temp_t6;
f32 *temp_v1;
f32 *temp_v1_2;
f32 temp_f0_2;
f32 temp_f12;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f16_3;
f32 temp_f2;
f64 temp_f0;
s16 *temp_t1;
s16 temp_t1_2;
s16 temp_v0;
s16 temp_v0_2;
s32 temp_hi;
s32 temp_hi_2;
s32 temp_t2;
s32 temp_t3;
s32 temp_t5;
s32 temp_t6_2;
s32 temp_v0_3;
u16 *temp_t4;
u16 temp_ra;
u16 temp_t4_2;
void *temp_s1;
f64 phi_f0;
f32 phi_f2;
f32 phi_f14;
f32 phi_f18;
temp_v0 = arg0->unkAE;
temp_t5 = arg3 * 4;
temp_a1 = temp_t5 + &D_80164688;
temp_t6 = temp_t5 + &D_80164648;
sp3C = temp_t6;
temp_v1 = temp_t5 + &D_80164658;
*temp_a1 = *(&D_80163068 + (temp_v0 * 4));
temp_f16 = *temp_t6;
temp_t2 = temp_v0 * 2;
*temp_t6 = temp_f16 + ((*temp_v1 - temp_f16) * 0.5f);
D_80163238 = (s32) temp_v0;
temp_ra = *(&D_801645B0 + temp_t2);
temp_t4 = &D_801645C8 + (temp_ra * 2);
temp_t4_2 = *temp_t4;
temp_t6_2 = arg3 * 2;
temp_t3 = temp_v0 * 0xDD8;
temp_t1 = temp_t6_2 + &D_80164668;
sp50 = (s32) temp_ra;
sp28 = temp_t1;
sp30 = temp_t3;
sp2C = temp_t6_2;
sp44 = temp_t5;
sp34 = temp_t2;
sp40 = temp_a1;
sp38 = temp_v1;
temp_s1 = gPlayerOne + temp_t3;
sp4C = (s32) temp_t4_2;
*sp28 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, *temp_t1, (s32) temp_ra);
temp_t1_2 = *sp28;
temp_hi = (s32) ((*(&D_80164438 + temp_t2) + temp_t4_2) - 2) % (s32) temp_t4_2;
sp9C = (s16) temp_hi;
sp9E = temp_t1_2;
if (func_80007BF8(temp_hi & 0xFFFF, temp_t1_2 & 0xFFFF, 1, 0xA, (s32) temp_t4_2) <= 0) {
sp44 = temp_t5;
sp4C = (s32) temp_t4_2;
func_8001A348(arg3, *sp40, *(&D_80164680 + sp2C));
} else {
if (((s32) temp_t1_2 < (s32) sp9C) && ((sp9C - temp_t1_2) < 3)) {
*temp_v1 = (f32) ((f64) *(&gPlayers->unk_094 + temp_t3) + 0.1);
}
if (((s32) sp9C < (s32) temp_t1_2) && ((temp_t1_2 - sp9C) < 3)) {
*temp_v1 = (f32) ((f64) *(&gPlayers->unk_094 + temp_t3) - 0.1);
}
temp_f0 = (f64) *temp_v1;
phi_f0 = temp_f0;
if (temp_f0 > 10.0) {
*temp_v1 = 10.0f;
phi_f0 = (f64) *temp_v1;
}
if (phi_f0 < 0.0) {
*temp_v1 = 0.0f;
}
}
temp_v0_2 = *sp28;
temp_hi_2 = (s32) (temp_v0_2 + 1) % (s32) *temp_t4;
sp60 = (u16) ((s32) (temp_v0_2 + 2) % (s32) *temp_t4);
sp62 = (s16) temp_hi_2;
sp44 = arg3 * 4;
sp38 = (f32 *) unksp52;
func_8000BBD8((s16) temp_hi_2 & 0xFFFF, *sp40, unksp52);
temp_f2 = (f32) ((f64) D_80162FA0.unk0 * 0.5);
temp_f14 = (f32) ((f64) D_80162FA0.unk8 * 0.5);
sp80 = temp_f2;
sp78 = temp_f14;
func_8000BBD8(sp60, *sp40, unksp52);
temp_v0_3 = *(&D_80164550 + (sp50 * 4));
temp_a2 = (arg3 * 4) + &D_80164618;
temp_f14_2 = (f32) ((f64) temp_f14 + ((f64) D_80162FA0.unk8 * 0.5));
temp_v1_2 = (arg3 * 4) + &D_801645F8;
temp_a3 = (arg3 * 4) + &D_80164638;
temp_f16_2 = (f32) ((f64) temp_f2 + ((f64) D_80162FA0.unk0 * 0.5)) - *temp_v1_2;
sp34 = temp_a3;
sp40 = temp_v1_2;
sp74 = temp_f16_2;
sp38 = temp_a2;
sp70 = (f32) ((f64) ((temp_v0_3 + ((s16) sp60 * 8))->unk2 + (temp_v0_3 + (sp62 * 8))->unk2) * 0.5) - *temp_a2;
sp6C = temp_f14_2 - *temp_a3;
temp_f0_2 = sqrtf((temp_f16_2 * temp_f16_2) + (sp70 * sp70) + (sp6C * sp6C), temp_f14_2, temp_a2, temp_a3);
if ((f64) temp_f0_2 != 0.0) {
temp_f16_3 = *sp3C;
phi_f2 = ((temp_f16_3 * sp74) / temp_f0_2) + *temp_v1_2;
phi_f14 = ((temp_f16_3 * sp6C) / temp_f0_2) + *temp_a3;
phi_f18 = ((temp_f16_3 * sp70) / temp_f0_2) + *temp_a2;
} else {
phi_f2 = *temp_v1_2;
phi_f14 = *temp_a3;
phi_f18 = *temp_a2;
}
arg0->unk0 = phi_f2;
arg0->unk8 = phi_f14;
arg0->unk4 = (f32) ((f64) temp_s1->unk18 + 10.0);
*temp_v1_2 = phi_f2;
*temp_a2 = phi_f18;
*temp_a3 = phi_f14;
arg0->unkC = (f32) temp_s1->unk14;
arg0->unk10 = (f32) ((f64) temp_s1->unk18 + 6.0);
arg0->unk14 = (f32) temp_s1->unk1C;
func_80014D30(arg3, sp50, temp_a2, temp_a3);
temp_f12 = arg0->unkC - arg0->unk0;
sp90 = arg0->unk10 - arg0->unk4;
sp94 = temp_f12;
temp_f14_3 = arg0->unk14 - arg0->unk8;
sp8C = temp_f14_3;
arg0->unk26 = func_802B7830(temp_f12, temp_f14_3);
arg0->unk24 = func_802B7830(sqrtf((sp94 * sp94) + (temp_f14_3 * temp_f14_3), temp_f14_3), sp90);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800180F0.s")
#endif