Files
SpaghettiKart/src/code_80005FD0.c
T
Tyler McGavran 2f6c87f14f Identify a credits related struct (#156)
Move some structs around, place them in more meaningful headers

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
2022-02-02 13:19:51 -07:00

13978 lines
424 KiB
C

#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include "code_80005FD0.h"
#include "variables.h"
s16 func_80005FD0(void) {
s16 temp_ret;
s16 phi_v1;
temp_ret = func_802B5224();
phi_v1 = temp_ret;
if (gIsMirrorMode != 0) {
phi_v1 = -temp_ret;
}
return phi_v1;
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECF74;
? func_80006018(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
f32 temp_f0;
f32 temp_f12;
f32 temp_f14;
f32 temp_f16;
f32 temp_f18;
f32 temp_f18_2;
f32 temp_f2;
? phi_v0;
temp_f0 = sqrtf((arg2 * arg2) + (arg3 * arg3));
if (temp_f0 < D_800ECF74) {
return 0;
}
temp_f16 = arg2 / temp_f0;
temp_f2 = arg6 - arg0;
temp_f14 = arg3 / temp_f0;
temp_f12 = arg7 - arg1;
temp_f18 = (temp_f16 * temp_f2) + (temp_f14 * temp_f12);
phi_v0 = 0;
if ((-arg4 < temp_f18) && (temp_f18 < arg4)) {
temp_f18_2 = (temp_f14 * temp_f2) + (-temp_f16 * temp_f12);
if ((-arg5 < temp_f18_2) && (temp_f18_2 < arg5)) {
phi_v0 = 1;
}
}
return phi_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80006018.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 sins(s32, s16, void *); // extern
f32 coss(s32); // extern
void func_80006114(void *arg0, void *arg1, s16 arg2) {
f32 sp34;
f32 sp30;
f32 sp24;
s32 sp1C;
f32 temp_f0;
f32 temp_f10;
f32 temp_f6;
s32 temp_a0;
void *temp_a3;
s16 phi_a2;
temp_a3 = arg0;
phi_a2 = arg2;
if (gIsMirrorMode != 0) {
phi_a2 = arg2 * -1;
}
temp_a0 = phi_a2 & 0xFFFF;
sp34 = temp_a3->unk0 - arg1->unk0;
temp_f10 = temp_a3->unk8;
arg0 = temp_a3;
sp1C = temp_a0;
sp30 = temp_f10 - arg1->unk8;
sp24 = sins(temp_a0, phi_a2, temp_a3);
temp_f0 = coss(temp_a0);
temp_f6 = (sp30 * temp_f0) - (sp34 * sp24);
arg0->unk0 = arg1->unk0 + ((sp34 * temp_f0) + (sp30 * sp24));
arg0->unk8 = arg1->unk8 + temp_f6;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80006114.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_800061DC(void *arg0, f32 arg1, s32 arg2) {
f32 temp_f0;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f12_4;
f32 temp_f12_5;
f32 temp_f12_6;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f14_4;
f32 temp_f14_5;
f32 temp_f14_6;
f32 temp_f2;
s32 temp_a0;
s32 temp_a1;
s32 temp_a1_2;
s32 temp_a1_3;
s32 temp_a3;
s32 temp_v0;
s8 temp_v0_2;
u16 temp_a2;
void *temp_a0_2;
void *temp_a0_3;
void *temp_a0_4;
void *temp_a0_5;
Player *phi_a0;
s32 phi_a1;
s32 phi_v0;
void *phi_a0_2;
s32 phi_a1_2;
void *phi_a0_3;
s32 phi_a1_3;
s32 phi_v1;
s32 phi_v1_2;
s32 phi_v1_3;
s32 phi_v1_4;
s32 phi_v1_5;
s32 phi_v1_6;
s32 phi_v1_7;
s32 phi_v1_8;
s32 phi_v1_9;
s32 phi_v1_10;
temp_v0 = gActiveScreenMode;
temp_f0 = arg0->unk0;
temp_f2 = arg0->unk8;
if (temp_v0 != 0) {
if ((temp_v0 != 1) && (temp_v0 != 2)) {
if (temp_v0 != 3) {
phi_v0 = 1;
} else {
phi_v0 = D_8018EDF3;
}
} else {
phi_v0 = 2;
}
} else {
phi_v0 = 1;
}
phi_a1 = 0;
phi_a1_2 = 0;
phi_a1_3 = 0;
phi_v1 = arg2;
phi_v1_5 = arg2;
phi_v1_6 = arg2;
phi_v1_10 = arg2;
if (D_800DC51C == 0) {
temp_v0_2 = D_8018EDF3;
phi_a0 = gPlayerOne;
if (temp_v0_2 > ZERO_PLAYERS_SELECTED) {
do {
temp_a2 = phi_a0->unk_000;
phi_v1_2 = phi_v1_5;
if (((temp_a2 & PLAYER_HUMAN) != 0) && ((temp_a2 & PLAYER_CPU) == 0)) {
temp_f12 = phi_a0->posX;
temp_f14 = phi_a0->posZ;
if (((temp_f12 - arg1) < temp_f0) && (temp_f0 < (temp_f12 + arg1)) && ((temp_f14 - arg1) < temp_f2) && (temp_f2 < (temp_f14 + arg1))) {
phi_v1_2 = phi_v1_5 | (1 << phi_a1);
} else {
phi_v1_2 = phi_v1_5 & ~(1 << phi_a1);
}
}
temp_a1 = phi_a1 + 1;
phi_a0 += 0xDD8;
phi_a1 = temp_a1;
phi_v1 = phi_v1_2;
phi_v1_5 = phi_v1_2;
} while (temp_a1 < temp_v0_2);
}
} else {
temp_a0 = camera1;
phi_a0_2 = temp_a0;
phi_a0_3 = temp_a0;
if (phi_v0 > 0) {
temp_a3 = phi_v0 & 3;
if (temp_a3 != 0) {
do {
temp_f14_2 = phi_a0_2->unk0;
if (((temp_f14_2 - arg1) < temp_f0) && (temp_f0 < (temp_f14_2 + arg1)) && (temp_f12_2 = phi_a0_2->unk8, ((temp_f12_2 - arg1) < temp_f2)) && (temp_f2 < (temp_f12_2 + arg1))) {
phi_v1_3 = phi_v1_6 | (1 << phi_a1_2);
} else {
phi_v1_3 = phi_v1_6 & ~(1 << phi_a1_2);
}
temp_a1_2 = phi_a1_2 + 1;
temp_a0_2 = phi_a0_2 + 0xB8;
phi_a0_2 = temp_a0_2;
phi_a1_2 = temp_a1_2;
phi_a0_3 = temp_a0_2;
phi_a1_3 = temp_a1_2;
phi_v1 = phi_v1_3;
phi_v1_6 = phi_v1_3;
phi_v1_10 = phi_v1_3;
} while (temp_a3 != temp_a1_2);
if (temp_a1_2 != phi_v0) {
goto loop_30;
}
} else {
do {
loop_30:
temp_f14_3 = phi_a0_3->unk0;
if (((temp_f14_3 - arg1) < temp_f0) && (temp_f0 < (temp_f14_3 + arg1)) && (temp_f12_3 = phi_a0_3->unk8, ((temp_f12_3 - arg1) < temp_f2)) && (temp_f2 < (temp_f12_3 + arg1))) {
phi_v1_9 = phi_v1_10 | (1 << phi_a1_3);
} else {
phi_v1_9 = phi_v1_10 & ~(1 << phi_a1_3);
}
temp_f14_4 = phi_a0_3->unkB8;
temp_a0_3 = phi_a0_3 + 0xB8;
if (((temp_f14_4 - arg1) < temp_f0) && (temp_f0 < (temp_f14_4 + arg1)) && (temp_f12_4 = temp_a0_3->unk8, ((temp_f12_4 - arg1) < temp_f2)) && (temp_f2 < (temp_f12_4 + arg1))) {
phi_v1_8 = phi_v1_9 | (1 << (phi_a1_3 + 1));
} else {
phi_v1_8 = phi_v1_9 & ~(1 << (phi_a1_3 + 1));
}
temp_f14_5 = temp_a0_3->unkB8;
temp_a0_4 = temp_a0_3 + 0xB8;
if (((temp_f14_5 - arg1) < temp_f0) && (temp_f0 < (temp_f14_5 + arg1)) && (temp_f12_5 = temp_a0_4->unk8, ((temp_f12_5 - arg1) < temp_f2)) && (temp_f2 < (temp_f12_5 + arg1))) {
phi_v1_7 = phi_v1_8 | (1 << (phi_a1_3 + 2));
} else {
phi_v1_7 = phi_v1_8 & ~(1 << (phi_a1_3 + 2));
}
temp_f14_6 = temp_a0_4->unkB8;
temp_a0_5 = temp_a0_4 + 0xB8;
if (((temp_f14_6 - arg1) < temp_f0) && (temp_f0 < (temp_f14_6 + arg1)) && (temp_f12_6 = temp_a0_5->unk8, ((temp_f12_6 - arg1) < temp_f2)) && (temp_f2 < (temp_f12_6 + arg1))) {
phi_v1_4 = phi_v1_7 | (1 << (phi_a1_3 + 3));
} else {
phi_v1_4 = phi_v1_7 & ~(1 << (phi_a1_3 + 3));
}
temp_a1_3 = phi_a1_3 + 4;
phi_a0_3 = temp_a0_5 + 0xB8;
phi_a1_3 = temp_a1_3;
phi_v1 = phi_v1_4;
phi_v1_10 = phi_v1_4;
} while (temp_a1_3 != phi_v0);
}
}
}
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800061DC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function func_800065D0:
Label L8000676C refers to a delay slot; this is currently not supported.
Please modify the assembly to work around it (e.g. copy the instruction
to all jump sources and move the label, or add a nop to the delay slot).
*/
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800065D0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? gTimePlayerLastTouchedFinishLine;
extern ? gCourseCompletionPercentByRank;
extern s16 D_8016348C;
extern s16 D_80164360;
extern ? D_80164378;
extern ? D_801643D8;
extern ? D_801643E0;
extern ? D_80164408;
extern ? gCourseCompletionPercentByPlayerId;
extern ? gPlayers;
void set_places(void) {
? sp80;
s32 sp30;
? *temp_v0_9;
f32 *temp_s1;
f32 *temp_s1_2;
f32 *temp_v1_10;
f32 *temp_v1_11;
f32 *temp_v1_5;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
f32 temp_f2_6;
s16 *temp_a2;
s16 *temp_t2;
s16 *temp_t2_2;
s16 temp_a0;
s16 temp_a0_10;
s16 temp_a0_2;
s16 temp_a0_3;
s16 temp_a0_4;
s16 temp_a0_5;
s16 temp_a0_6;
s16 temp_a0_7;
s16 temp_a0_8;
s16 temp_a0_9;
s16 temp_a1_10;
s16 temp_a1_11;
s16 temp_a1_12;
s16 temp_a1_13;
s16 temp_a1_8;
s32 *temp_s0;
s32 *temp_s0_4;
s32 *temp_s3;
s32 *temp_s3_3;
s32 *temp_v0_10;
s32 *temp_v0_13;
s32 *temp_v0_14;
s32 *temp_v0_15;
s32 *temp_v0_16;
s32 *temp_v0_6;
s32 *temp_v0_7;
s32 *temp_v0_8;
s32 *temp_v1_6;
s32 temp_a1;
s32 temp_a1_14;
s32 temp_a1_15;
s32 temp_a1_2;
s32 temp_a1_3;
s32 temp_a1_4;
s32 temp_a1_5;
s32 temp_a1_6;
s32 temp_a1_7;
s32 temp_a1_9;
s32 temp_a3;
s32 temp_a3_2;
s32 temp_s0_2;
s32 temp_s0_3;
s32 temp_s0_5;
s32 temp_s2;
s32 temp_s2_2;
s32 temp_s2_3;
s32 temp_s2_4;
s32 temp_s2_5;
s32 temp_s2_6;
s32 temp_t0;
s32 temp_t0_2;
s32 temp_t0_3;
s32 temp_t0_4;
s32 temp_t0_5;
s32 temp_t0_6;
s32 temp_t0_7;
s32 temp_t3;
s32 temp_t3_2;
s32 temp_t3_3;
s32 temp_t3_4;
s32 temp_t3_5;
s32 temp_t3_6;
s32 temp_t8;
s32 temp_v0;
s32 temp_v1_12;
s32 temp_v1_13;
s32 temp_v1_7;
s32 temp_v1_8;
void *temp_a2_2;
void *temp_a2_3;
void *temp_s1_3;
void *temp_s3_2;
void *temp_s3_4;
void *temp_t2_3;
void *temp_t2_4;
void *temp_v0_11;
void *temp_v0_12;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v1;
void *temp_v1_2;
void *temp_v1_3;
void *temp_v1_4;
void *temp_v1_9;
s32 phi_t4;
s16 *phi_t2;
void *phi_v0;
void *phi_v1;
s32 phi_t1;
s16 *phi_t2_2;
void *phi_v0_2;
void *phi_v1_2;
s16 *phi_t2_3;
void *phi_v0_3;
void *phi_v1_3;
s32 phi_t1_2;
s16 *phi_t2_4;
void *phi_v0_4;
void *phi_v1_4;
s16 *phi_t2_5;
s32 phi_t1_3;
s32 phi_t3;
void *phi_s1;
s32 phi_s0;
s32 phi_t3_2;
s32 *phi_v1_5;
? *phi_v0_5;
s32 phi_t3_3;
s32 *phi_v0_6;
void *phi_t2_6;
s32 phi_t1_4;
s32 phi_t3_4;
s32 *phi_v0_7;
void *phi_t2_7;
s32 phi_t1_5;
s16 *phi_a2;
void *phi_v0_8;
void *phi_v1_6;
s32 phi_t1_6;
s16 *phi_a2_2;
void *phi_v0_9;
f32 *phi_v1_7;
s32 phi_t1_7;
s32 phi_t3_5;
void *phi_s1_2;
s32 phi_t3_6;
s32 phi_t3_7;
s32 *phi_v0_10;
void *phi_a2_3;
s32 phi_t1_8;
s32 phi_t3_8;
s32 *phi_v0_11;
void *phi_a2_4;
s32 phi_t1_9;
s32 phi_t3_9;
s32 phi_t3_10;
s32 phi_s0_2;
s32 phi_t3_11;
s32 phi_t3_12;
s32 phi_t3_13;
s32 phi_s0_3;
s32 phi_t3_14;
s32 phi_t3_15;
temp_v0 = gModeSelection;
if ((temp_v0 != GRAND_PRIX) && (temp_v0 != TIME_TRIALS)) {
if (temp_v0 != VERSUS) {
if (temp_v0 != BATTLE) {
return;
}
// Duplicate return node #82. Try simplifying control flow for better match
return;
}
phi_t4 = D_8018EDF3;
goto block_7;
}
phi_t4 = 8;
block_7:
if (D_8016348C == 0) {
phi_t3_9 = 0;
if (phi_t4 > 0) {
temp_t0 = phi_t4 & 3;
if (temp_t0 != 0) {
temp_a1 = 0 * 4;
phi_t2 = (0 * 2) + &D_80164360;
phi_v0 = temp_a1 + &sp80;
phi_v1 = temp_a1 + &gCourseCompletionPercentByRank;
phi_t1 = 1;
do {
temp_a0 = *phi_t2;
temp_v0_2 = phi_v0 + 4;
temp_v1 = phi_v1 + 4;
temp_v0_2->unk-4 = temp_a0;
temp_v1->unk-4 = *(&gCourseCompletionPercentByPlayerId + (temp_a0 * 4));
phi_t2 += 2;
phi_v0 = temp_v0_2;
phi_v1 = temp_v1;
phi_t1 += 1;
phi_t3_9 = phi_t1;
} while (temp_t0 != phi_t1);
if (phi_t1 != phi_t4) {
goto block_13;
}
} else {
block_13:
temp_a1_2 = phi_t3_9 * 4;
phi_t2_2 = (phi_t3_9 * 2) + &D_80164360;
phi_v0_2 = temp_a1_2 + &sp80;
phi_v1_2 = temp_a1_2 + &gCourseCompletionPercentByRank;
do {
temp_a0_2 = *phi_t2_2;
temp_v1_2 = phi_v1_2 + 0x10;
temp_t2 = phi_t2_2 + 8;
phi_v0_2->unk0 = temp_a0_2;
temp_a0_3 = temp_t2->unk-6;
phi_v0_2->unk4 = temp_a0_3;
temp_a0_4 = temp_t2->unk-4;
phi_v0_2->unk8 = temp_a0_4;
temp_a0_5 = temp_t2->unk-2;
temp_v1_2->unk-10 = *(&gCourseCompletionPercentByPlayerId + (temp_a0_2 * 4));
temp_v0_3 = phi_v0_2 + 0x10;
temp_v1_2->unk-C = *(&gCourseCompletionPercentByPlayerId + (temp_a0_3 * 4));
temp_v0_3->unk-4 = temp_a0_5;
temp_v1_2->unk-4 = *(&gCourseCompletionPercentByPlayerId + (temp_a0_5 * 4));
temp_v1_2->unk-8 = *(&gCourseCompletionPercentByPlayerId + (temp_a0_4 * 4));
phi_t2_2 = temp_t2;
phi_v0_2 = temp_v0_3;
phi_v1_2 = temp_v1_2;
} while (temp_v1_2 != ((phi_t4 * 4) + &gCourseCompletionPercentByRank));
}
}
phi_t3 = 0;
} else {
phi_t3_10 = 0;
phi_t3 = 0;
if (phi_t4 > 0) {
temp_t0_2 = phi_t4 & 3;
if (temp_t0_2 != 0) {
temp_a1_3 = 0 * 4;
phi_t2_3 = (0 * 2) + &D_80164360;
phi_v0_3 = temp_a1_3 + &sp80;
phi_v1_3 = temp_a1_3 + &gCourseCompletionPercentByRank;
phi_t1_2 = 1;
do {
temp_a0_6 = *phi_t2_3;
temp_v0_4 = phi_v0_3 + 4;
temp_v1_3 = phi_v1_3 + 4;
temp_v0_4->unk-4 = temp_a0_6;
temp_v1_3->unk-4 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_6 * 4));
phi_t2_3 += 2;
phi_v0_3 = temp_v0_4;
phi_v1_3 = temp_v1_3;
phi_t1_2 += 1;
phi_t3_10 = phi_t1_2;
} while (temp_t0_2 != phi_t1_2);
if (phi_t1_2 != phi_t4) {
goto block_22;
}
} else {
block_22:
temp_a1_4 = phi_t3_10 * 4;
phi_t2_4 = (phi_t3_10 * 2) + &D_80164360;
phi_v0_4 = temp_a1_4 + &sp80;
phi_v1_4 = temp_a1_4 + &gCourseCompletionPercentByRank;
do {
temp_a0_7 = *phi_t2_4;
temp_v1_4 = phi_v1_4 + 0x10;
temp_t2_2 = phi_t2_4 + 8;
phi_v0_4->unk0 = temp_a0_7;
temp_a0_8 = temp_t2_2->unk-6;
phi_v0_4->unk4 = temp_a0_8;
temp_a0_9 = temp_t2_2->unk-4;
phi_v0_4->unk8 = temp_a0_9;
temp_a0_10 = temp_t2_2->unk-2;
temp_v1_4->unk-10 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_7 * 4));
temp_v1_4->unk-4 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_10 * 4));
temp_v1_4->unk-8 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_9 * 4));
temp_v1_4->unk-C = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_8 * 4));
temp_v0_5 = phi_v0_4 + 0x10;
temp_v0_5->unk-4 = temp_a0_10;
phi_t2_4 = temp_t2_2;
phi_v0_4 = temp_v0_5;
phi_v1_4 = temp_v1_4;
} while (temp_v1_4 != ((phi_t4 * 4) + &gCourseCompletionPercentByRank));
}
}
}
temp_t8 = phi_t4 - 1;
sp30 = temp_t8;
if (temp_t8 > 0) {
phi_t2_5 = &D_80164360;
phi_t1_3 = 1;
do {
if ((*(&gPlayers + (*phi_t2_5 * 0xDD8)) & 0x800) == 0) {
phi_s0_2 = phi_t1_3;
if (phi_t1_3 < phi_t4) {
temp_a1_5 = phi_t3 * 4;
temp_v1_5 = temp_a1_5 + &gCourseCompletionPercentByRank;
if (((phi_t4 - phi_t1_3) & 1) != 0) {
temp_t3 = phi_t1_3 * 4;
temp_s1 = temp_t3 + &gCourseCompletionPercentByRank;
temp_f2 = *temp_s1;
temp_f0 = *temp_v1_5;
if (temp_f0 < temp_f2) {
temp_v0_6 = &sp80 + temp_a1_5;
temp_s0 = &sp80 + temp_t3;
if ((*(&gPlayers + (*(&D_80164360 + (phi_t1_3 * 2)) * 0xDD8)) & 0x800) == 0) {
temp_s2 = *temp_v0_6;
*temp_v1_5 = temp_f2;
*temp_v0_6 = *temp_s0;
*temp_s1 = temp_f0;
*temp_s0 = temp_s2;
}
}
temp_s0_2 = phi_t1_3 + 1;
phi_s0_2 = temp_s0_2;
if (temp_s0_2 != phi_t4) {
goto block_34;
}
} else {
block_34:
temp_t3_2 = phi_s0_2 * 4;
phi_s1 = temp_t3_2 + &gCourseCompletionPercentByRank;
phi_s0 = phi_s0_2;
phi_t3_2 = temp_t3_2;
do {
temp_f0_2 = *temp_v1_5;
temp_f2_2 = phi_s1->unk0;
if (temp_f0_2 < temp_f2_2) {
temp_v0_7 = &sp80 + temp_a1_5;
temp_s3 = &sp80 + phi_t3_2;
if ((*(&gPlayers + (*(&D_80164360 + (phi_s0 * 2)) * 0xDD8)) & 0x800) == 0) {
temp_s2_2 = *temp_v0_7;
temp_f12 = temp_f0_2;
*temp_v1_5 = temp_f2_2;
phi_s1->unk0 = temp_f12;
*temp_v0_7 = *temp_s3;
*temp_s3 = temp_s2_2;
}
}
temp_f2_3 = phi_s1->unk4;
if (*temp_v1_5 < temp_f2_3) {
temp_v0_8 = &sp80 + temp_a1_5;
temp_s3_2 = &sp80 + phi_t3_2;
if ((*(&gPlayers + ((&D_80164360 + (phi_s0 * 2))->unk2 * 0xDD8)) & 0x800) == 0) {
temp_s2_3 = *temp_v0_8;
*temp_v1_5 = temp_f2_3;
*temp_v0_8 = temp_s3_2->unk4;
phi_s1->unk4 = *temp_v1_5;
temp_s3_2->unk4 = temp_s2_3;
}
}
temp_s0_3 = phi_s0 + 2;
phi_s1 += 8;
phi_s0 = temp_s0_3;
phi_t3_2 += 8;
} while (temp_s0_3 != phi_t4);
}
}
}
phi_t2_5 += 2;
phi_t1_3 += 1;
phi_t3 = phi_t1_3;
} while (phi_t1_3 != sp30);
}
phi_v1_5 = gPlayerPositions;
phi_v0_5 = &D_801643E0;
phi_t1_4 = 1;
phi_t1_7 = 1;
do {
temp_v1_6 = phi_v1_5 + 4;
temp_v0_9 = phi_v0_5 + 4;
temp_v0_9->unk-4 = *phi_v1_5;
phi_v1_5 = temp_v1_6;
phi_v0_5 = temp_v0_9;
} while (temp_v1_6 < &D_801643D8);
phi_t3_3 = 0;
phi_t3_11 = 0;
phi_t3_13 = 0;
phi_t3_14 = 0;
if (phi_t4 > 0) {
temp_t0_3 = phi_t4 & 3;
if (temp_t0_3 != 0) {
phi_v0_6 = &sp80 + (0 * 4);
phi_t2_6 = (0 * 2) + &D_80164360;
do {
temp_v1_7 = *phi_v0_6;
temp_t2_3 = phi_t2_6 + 2;
gPlayerPositions[temp_v1_7] = phi_t3_3;
temp_t2_3->unk-2 = temp_v1_7;
phi_t3_3 = phi_t1_4;
phi_v0_6 += 4;
phi_t2_6 = temp_t2_3;
phi_t1_4 += 1;
phi_t3_11 = phi_t1_4;
} while (temp_t0_3 != phi_t1_4);
if (phi_t1_4 != phi_t4) {
goto block_50;
}
} else {
block_50:
phi_t3_4 = phi_t3_11;
phi_v0_7 = &sp80 + (phi_t3_11 * 4);
phi_t2_7 = (phi_t3_11 * 2) + &D_80164360;
phi_t1_5 = phi_t3_11 + 1;
do {
temp_v1_8 = *phi_v0_7;
temp_t2_4 = phi_t2_7 + 8;
temp_v0_10 = phi_v0_7 + 0x10;
gPlayerPositions[temp_v1_8] = phi_t3_4;
temp_a1_6 = temp_v0_10->unk-C;
temp_t2_4->unk-8 = temp_v1_8;
gPlayerPositions[temp_a1_6] = phi_t1_5;
temp_a3 = temp_v0_10->unk-8;
temp_t3_3 = phi_t3_4 + 4;
gPlayerPositions[temp_a3] = phi_t3_4 + 2;
temp_t0_4 = temp_v0_10->unk-4;
temp_t2_4->unk-6 = temp_a1_6;
gPlayerPositions[temp_t0_4] = phi_t3_4 + 3;
temp_t2_4->unk-4 = temp_a3;
temp_t2_4->unk-2 = temp_t0_4;
phi_t3_4 = temp_t3_3;
phi_v0_7 = temp_v0_10;
phi_t2_7 = temp_t2_4;
phi_t1_5 += 4;
} while (temp_t3_3 != phi_t4);
}
}
temp_t0_5 = phi_t4 & 3;
phi_t3_12 = 0;
phi_t3_13 = 0;
if (phi_t4 > 0) {
if (temp_t0_5 != 0) {
temp_a1_7 = 0 * 4;
phi_a2 = (0 * 2) + &D_80164378;
phi_v0_8 = &sp80 + temp_a1_7;
phi_v1_6 = temp_a1_7 + &gCourseCompletionPercentByRank;
phi_t1_6 = 0 + 1;
do {
temp_a1_8 = *phi_a2;
temp_v0_11 = phi_v0_8 + 4;
temp_v1_9 = phi_v1_6 + 4;
temp_v0_11->unk-4 = temp_a1_8;
temp_v1_9->unk-4 = *(&gCourseCompletionPercentByPlayerId + (temp_a1_8 * 4));
phi_a2 += 2;
phi_v0_8 = temp_v0_11;
phi_v1_6 = temp_v1_9;
phi_t1_6 += 1;
phi_t3_12 = phi_t1_6;
} while (temp_t0_5 != phi_t1_6);
if (phi_t1_6 != phi_t4) {
goto block_58;
}
} else {
block_58:
temp_a1_9 = phi_t3_12 * 4;
phi_a2_2 = (phi_t3_12 * 2) + &D_80164378;
phi_v0_9 = &sp80 + temp_a1_9;
phi_v1_7 = temp_a1_9 + &gCourseCompletionPercentByRank;
do {
temp_a1_10 = *phi_a2_2;
temp_a2 = phi_a2_2 + 8;
temp_v0_12 = phi_v0_9 + 0x10;
temp_v0_12->unk-10 = temp_a1_10;
temp_a1_11 = temp_a2->unk-6;
temp_v0_12->unk-C = temp_a1_11;
temp_a1_12 = temp_a2->unk-4;
temp_v0_12->unk-8 = temp_a1_12;
temp_a1_13 = temp_a2->unk-2;
*phi_v1_7 = *(&gCourseCompletionPercentByPlayerId + (temp_a1_10 * 4));
temp_v1_10 = phi_v1_7 + 0x10;
temp_v1_10->unk-C = *(&gCourseCompletionPercentByPlayerId + (temp_a1_11 * 4));
temp_v0_12->unk-4 = temp_a1_13;
temp_v1_10->unk-4 = *(&gCourseCompletionPercentByPlayerId + (temp_a1_13 * 4));
temp_v1_10->unk-8 = *(&gCourseCompletionPercentByPlayerId + (temp_a1_12 * 4));
phi_a2_2 = temp_a2;
phi_v0_9 = temp_v0_12;
phi_v1_7 = temp_v1_10;
} while (temp_a2 != ((phi_t4 * 2) + &D_80164378));
}
}
phi_t3_5 = phi_t3_13;
phi_t3_14 = phi_t3_13;
if (sp30 > 0) {
do {
phi_s0_3 = phi_t1_7;
if (phi_t1_7 < phi_t4) {
temp_a1_14 = phi_t3_5 * 4;
temp_v1_11 = temp_a1_14 + &gCourseCompletionPercentByRank;
if (((phi_t4 - phi_t1_7) & 1) != 0) {
temp_t3_4 = phi_t1_7 * 4;
temp_s1_2 = temp_t3_4 + &gCourseCompletionPercentByRank;
temp_f2_4 = *temp_s1_2;
temp_f0_3 = *temp_v1_11;
temp_s0_4 = &sp80 + temp_t3_4;
temp_v0_13 = &sp80 + temp_a1_14;
if (temp_f0_3 < temp_f2_4) {
temp_s2_4 = *temp_v0_13;
*temp_v1_11 = temp_f2_4;
*temp_v0_13 = *temp_s0_4;
*temp_s1_2 = temp_f0_3;
*temp_s0_4 = temp_s2_4;
}
temp_s0_5 = phi_t1_7 + 1;
phi_s0_3 = temp_s0_5;
if (temp_s0_5 != phi_t4) {
goto block_67;
}
} else {
block_67:
temp_t3_5 = phi_s0_3 * 4;
phi_s1_2 = temp_t3_5 + &gCourseCompletionPercentByRank;
phi_t3_6 = temp_t3_5;
do {
temp_f0_4 = *temp_v1_11;
temp_f2_5 = phi_s1_2->unk0;
temp_v0_14 = &sp80 + temp_a1_14;
temp_s3_3 = &sp80 + phi_t3_6;
if (temp_f0_4 < temp_f2_5) {
temp_s2_5 = *temp_v0_14;
temp_f12_2 = temp_f0_4;
*temp_v1_11 = temp_f2_5;
phi_s1_2->unk0 = temp_f12_2;
*temp_v0_14 = *temp_s3_3;
*temp_s3_3 = temp_s2_5;
}
temp_f2_6 = phi_s1_2->unk4;
temp_v0_15 = &sp80 + temp_a1_14;
temp_s3_4 = &sp80 + phi_t3_6;
if (*temp_v1_11 < temp_f2_6) {
temp_s2_6 = *temp_v0_15;
*temp_v1_11 = temp_f2_6;
*temp_v0_15 = temp_s3_4->unk4;
phi_s1_2->unk4 = *temp_v1_11;
temp_s3_4->unk4 = temp_s2_6;
}
temp_s1_3 = phi_s1_2 + 8;
phi_s1_2 = temp_s1_3;
phi_t3_6 += 8;
} while (temp_s1_3 != ((phi_t4 * 4) + &gCourseCompletionPercentByRank));
}
}
phi_t1_7 += 1;
phi_t3_5 = phi_t1_7;
} while (phi_t1_7 != sp30);
}
temp_t0_6 = phi_t4 & 3;
phi_t3_7 = phi_t3_14;
phi_t3_15 = phi_t3_14;
if (phi_t4 > 0) {
if (temp_t0_6 != 0) {
phi_v0_10 = (phi_t3_14 * 4) + &sp80;
phi_a2_3 = (phi_t3_14 * 2) + &D_80164378;
phi_t1_8 = phi_t3_14 + 1;
do {
temp_v1_12 = *phi_v0_10;
temp_a2_2 = phi_a2_3 + 2;
*(&D_80164408 + (temp_v1_12 * 4)) = phi_t3_7;
temp_a2_2->unk-2 = temp_v1_12;
phi_t3_7 = phi_t1_8;
phi_v0_10 += 4;
phi_a2_3 = temp_a2_2;
phi_t1_8 += 1;
phi_t3_15 = phi_t1_8;
} while (temp_t0_6 != phi_t1_8);
if (phi_t1_8 != phi_t4) {
goto block_80;
}
} else {
block_80:
phi_t3_8 = phi_t3_15;
phi_v0_11 = (phi_t3_15 * 4) + &sp80;
phi_a2_4 = (phi_t3_15 * 2) + &D_80164378;
phi_t1_9 = phi_t3_15 + 1;
do {
temp_v1_13 = *phi_v0_11;
temp_v0_16 = phi_v0_11 + 0x10;
temp_a2_3 = phi_a2_4 + 8;
*(&D_80164408 + (temp_v1_13 * 4)) = phi_t3_8;
temp_a1_15 = temp_v0_16->unk-C;
temp_a2_3->unk-8 = temp_v1_13;
*(&D_80164408 + (temp_a1_15 * 4)) = phi_t1_9;
temp_a3_2 = temp_v0_16->unk-8;
temp_t3_6 = phi_t3_8 + 4;
*(&D_80164408 + (temp_a3_2 * 4)) = phi_t3_8 + 2;
temp_t0_7 = temp_v0_16->unk-4;
temp_a2_3->unk-6 = temp_a1_15;
*(&D_80164408 + (temp_t0_7 * 4)) = phi_t3_8 + 3;
temp_a2_3->unk-4 = temp_a3_2;
temp_a2_3->unk-2 = temp_t0_7;
phi_t3_8 = temp_t3_6;
phi_v0_11 = temp_v0_16;
phi_a2_4 = temp_a2_3;
phi_t1_9 += 4;
} while (temp_t3_6 != phi_t4);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/set_places.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? gTimePlayerLastTouchedFinishLine;
extern ? gCourseCompletionPercentByRank;
extern ? D_80164360;
extern ? D_801643D8;
extern ? D_801643E0;
void func_800070F4(void) {
? sp50;
? *temp_v0_8;
f32 *temp_t3;
f32 *temp_v1_3;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f12;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
s16 *temp_t0;
s16 temp_a0_2;
s16 temp_a0_4;
s16 temp_a0_5;
s16 temp_a0_6;
s16 temp_a0_7;
s32 *temp_t1;
s32 *temp_t3_2;
s32 *temp_v0_4;
s32 *temp_v0_6;
s32 *temp_v0_7;
s32 *temp_v0_9;
s32 *temp_v1_4;
s32 temp_a0;
s32 temp_a0_3;
s32 temp_a0_8;
s32 temp_a0_9;
s32 temp_a3;
s32 temp_a3_2;
s32 temp_a3_3;
s32 temp_t0_2;
s32 temp_t1_3;
s32 temp_t2;
s32 temp_t2_2;
s32 temp_t2_3;
s32 temp_t2_4;
s32 temp_t2_5;
s32 temp_t2_6;
s32 temp_v0;
s32 temp_v0_5;
s32 temp_v1_5;
s32 temp_v1_6;
void *temp_t0_3;
void *temp_t0_4;
void *temp_t1_2;
void *temp_t3_3;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v1;
void *temp_v1_2;
s32 phi_a2;
s16 *phi_t0;
void *phi_v0;
void *phi_v1;
s32 phi_a1;
s16 *phi_t0_2;
void *phi_v0_2;
void *phi_v1_2;
s32 phi_a1_2;
s32 phi_a3;
void *phi_t1;
s32 phi_a3_2;
s32 *phi_v1_3;
? *phi_v0_3;
s32 phi_a3_3;
s32 *phi_v0_4;
void *phi_t0_3;
s32 phi_a1_3;
s32 phi_a3_4;
s32 *phi_v0_5;
void *phi_t0_4;
s32 phi_a1_4;
s32 phi_a3_5;
s32 phi_v0_6;
s32 phi_a3_6;
temp_v0 = gModeSelection;
if ((temp_v0 != GRAND_PRIX) && (temp_v0 != TIME_TRIALS)) {
if (temp_v0 != VERSUS) {
if (temp_v0 != BATTLE) {
return;
}
// Duplicate return node #37. Try simplifying control flow for better match
return;
}
phi_a2 = D_8018EDF3;
goto block_7;
}
phi_a2 = 8;
block_7:
phi_a3_3 = 0;
phi_a3_5 = 0;
phi_a3_6 = 0;
if (phi_a2 > 0) {
temp_t2 = phi_a2 & 3;
if (temp_t2 != 0) {
temp_a0 = 0 * 4;
phi_t0 = (0 * 2) + &D_80164360;
phi_v0 = temp_a0 + &sp50;
phi_v1 = temp_a0 + &gCourseCompletionPercentByRank;
phi_a1 = 1;
do {
temp_a0_2 = *phi_t0;
temp_v0_2 = phi_v0 + 4;
temp_v1 = phi_v1 + 4;
temp_v0_2->unk-4 = temp_a0_2;
temp_v1->unk-4 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_2 * 4));
phi_t0 += 2;
phi_v0 = temp_v0_2;
phi_v1 = temp_v1;
phi_a1 += 1;
phi_a3_5 = phi_a1;
} while (temp_t2 != phi_a1);
if (phi_a1 != phi_a2) {
goto block_12;
}
} else {
block_12:
temp_a0_3 = phi_a3_5 * 4;
phi_t0_2 = (phi_a3_5 * 2) + &D_80164360;
phi_v0_2 = temp_a0_3 + &sp50;
phi_v1_2 = temp_a0_3 + &gCourseCompletionPercentByRank;
do {
temp_a0_4 = *phi_t0_2;
temp_v1_2 = phi_v1_2 + 0x10;
temp_t0 = phi_t0_2 + 8;
phi_v0_2->unk0 = temp_a0_4;
temp_a0_5 = temp_t0->unk-6;
phi_v0_2->unk4 = temp_a0_5;
temp_a0_6 = temp_t0->unk-4;
phi_v0_2->unk8 = temp_a0_6;
temp_a0_7 = temp_t0->unk-2;
temp_v1_2->unk-10 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_4 * 4));
temp_v1_2->unk-4 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_7 * 4));
temp_v1_2->unk-8 = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_6 * 4));
temp_v1_2->unk-C = -*(&gTimePlayerLastTouchedFinishLine + (temp_a0_5 * 4));
temp_v0_3 = phi_v0_2 + 0x10;
temp_v0_3->unk-4 = temp_a0_7;
phi_t0_2 = temp_t0;
phi_v0_2 = temp_v0_3;
phi_v1_2 = temp_v1_2;
} while (temp_v1_2 != ((phi_a2 * 4) + &gCourseCompletionPercentByRank));
}
}
temp_t0_2 = phi_a2 - 1;
phi_a1_2 = 1;
phi_a3 = 0;
phi_a1_3 = 1;
if (temp_t0_2 > 0) {
do {
phi_v0_6 = phi_a1_2;
if (phi_a1_2 < phi_a2) {
temp_a0_8 = phi_a3 * 4;
temp_v1_3 = temp_a0_8 + &gCourseCompletionPercentByRank;
if (((phi_a2 - phi_a1_2) & 1) != 0) {
temp_a3 = phi_a1_2 * 4;
temp_t3 = temp_a3 + &gCourseCompletionPercentByRank;
temp_f2 = *temp_t3;
temp_f0 = *temp_v1_3;
temp_t1 = &sp50 + temp_a3;
temp_v0_4 = &sp50 + temp_a0_8;
if (temp_f0 < temp_f2) {
temp_t2_2 = *temp_v0_4;
*temp_v1_3 = temp_f2;
*temp_v0_4 = *temp_t1;
*temp_t3 = temp_f0;
*temp_t1 = temp_t2_2;
}
temp_v0_5 = phi_a1_2 + 1;
phi_v0_6 = temp_v0_5;
if (temp_v0_5 != phi_a2) {
goto block_21;
}
} else {
block_21:
temp_a3_2 = phi_v0_6 * 4;
phi_t1 = temp_a3_2 + &gCourseCompletionPercentByRank;
phi_a3_2 = temp_a3_2;
do {
temp_f0_2 = *temp_v1_3;
temp_f2_2 = phi_t1->unk0;
temp_v0_6 = &sp50 + temp_a0_8;
temp_t3_2 = &sp50 + phi_a3_2;
if (temp_f0_2 < temp_f2_2) {
temp_t2_3 = *temp_v0_6;
temp_f12 = temp_f0_2;
*temp_v1_3 = temp_f2_2;
phi_t1->unk0 = temp_f12;
*temp_v0_6 = *temp_t3_2;
*temp_t3_2 = temp_t2_3;
}
temp_f2_3 = phi_t1->unk4;
temp_v0_7 = &sp50 + temp_a0_8;
temp_t3_3 = &sp50 + phi_a3_2;
if (*temp_v1_3 < temp_f2_3) {
temp_t2_4 = *temp_v0_7;
*temp_v1_3 = temp_f2_3;
*temp_v0_7 = temp_t3_3->unk4;
phi_t1->unk4 = *temp_v1_3;
temp_t3_3->unk4 = temp_t2_4;
}
temp_t1_2 = phi_t1 + 8;
phi_t1 = temp_t1_2;
phi_a3_2 += 8;
} while (temp_t1_2 != ((phi_a2 * 4) + &gCourseCompletionPercentByRank));
}
}
phi_a1_2 += 1;
phi_a3 = phi_a1_2;
} while (phi_a1_2 != temp_t0_2);
}
phi_v1_3 = gPlayerPositions;
phi_v0_3 = &D_801643E0;
do {
temp_v1_4 = phi_v1_3 + 4;
temp_v0_8 = phi_v0_3 + 4;
temp_v0_8->unk-4 = *phi_v1_3;
phi_v1_3 = temp_v1_4;
phi_v0_3 = temp_v0_8;
} while (temp_v1_4 < &D_801643D8);
if (phi_a2 > 0) {
temp_t2_5 = phi_a2 & 3;
if (temp_t2_5 != 0) {
phi_v0_4 = (0 * 4) + &sp50;
phi_t0_3 = (0 * 2) + &D_80164360;
do {
temp_v1_5 = *phi_v0_4;
temp_t0_3 = phi_t0_3 + 2;
gPlayerPositions[temp_v1_5] = phi_a3_3;
temp_t0_3->unk-2 = temp_v1_5;
phi_a3_3 = phi_a1_3;
phi_v0_4 += 4;
phi_t0_3 = temp_t0_3;
phi_a1_3 += 1;
phi_a3_6 = phi_a1_3;
} while (temp_t2_5 != phi_a1_3);
if (phi_a1_3 != phi_a2) {
goto block_35;
}
} else {
block_35:
phi_a3_4 = phi_a3_6;
phi_v0_5 = (phi_a3_6 * 4) + &sp50;
phi_t0_4 = (phi_a3_6 * 2) + &D_80164360;
phi_a1_4 = phi_a3_6 + 1;
do {
temp_v1_6 = *phi_v0_5;
temp_t0_4 = phi_t0_4 + 8;
temp_v0_9 = phi_v0_5 + 0x10;
gPlayerPositions[temp_v1_6] = phi_a3_4;
temp_a0_9 = temp_v0_9->unk-C;
temp_t0_4->unk-8 = temp_v1_6;
gPlayerPositions[temp_a0_9] = phi_a1_4;
temp_t1_3 = temp_v0_9->unk-8;
temp_a3_3 = phi_a3_4 + 4;
gPlayerPositions[temp_t1_3] = phi_a3_4 + 2;
temp_t2_6 = temp_v0_9->unk-4;
temp_t0_4->unk-6 = temp_a0_9;
gPlayerPositions[temp_t2_6] = phi_a3_4 + 3;
temp_t0_4->unk-4 = temp_t1_3;
temp_t0_4->unk-2 = temp_t2_6;
phi_a3_4 = temp_a3_3;
phi_v0_5 = temp_v0_9;
phi_t0_4 = temp_t0_4;
phi_a1_4 += 4;
} while (temp_a3_3 != phi_a2);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800070F4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? gTimePlayerLastTouchedFinishLine;
extern f32 gCourseCompletionPercentByRank;
extern ? D_80164360;
extern ? D_801643D8;
extern ? D_801643E0;
extern ? gCourseCompletionPercentByPlayerId;
extern ? gPlayers;
void func_800074D4(void) {
? sp68;
? *temp_v0_9;
f32 *temp_a0;
f32 *temp_a0_2;
f32 *temp_t4;
f32 *temp_t4_3;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
f32 temp_f2_6;
s32 *temp_t0_3;
s32 *temp_t0_4;
s32 *temp_t0_6;
s32 *temp_t0_7;
s32 *temp_v0;
s32 *temp_v0_10;
s32 *temp_v0_3;
s32 *temp_v0_4;
s32 *temp_v0_5;
s32 *temp_v0_7;
s32 *temp_v0_8;
s32 *temp_v1_13;
s32 temp_a1;
s32 temp_a1_2;
s32 temp_a1_3;
s32 temp_a2;
s32 temp_a3;
s32 temp_s0;
s32 temp_s0_2;
s32 temp_s0_3;
s32 temp_s0_4;
s32 temp_s0_5;
s32 temp_s0_6;
s32 temp_t0;
s32 temp_t0_2;
s32 temp_t0_9;
s32 temp_t1;
s32 temp_t5;
s32 temp_v0_2;
s32 temp_v0_6;
s32 temp_v1;
s32 temp_v1_10;
s32 temp_v1_11;
s32 temp_v1_12;
s32 temp_v1_14;
s32 temp_v1_2;
s32 temp_v1_3;
s32 temp_v1_4;
s32 temp_v1_5;
s32 temp_v1_6;
s32 temp_v1_7;
s32 temp_v1_8;
s32 temp_v1_9;
void *temp_a0_3;
void *temp_t0_5;
void *temp_t0_8;
void *temp_t4_2;
void *temp_t4_4;
f32 *phi_a0;
s32 phi_a3;
void *phi_a0_2;
s32 phi_t0;
s32 phi_v0;
s32 phi_v0_2;
s32 phi_v0_3;
s32 phi_v0_4;
void *phi_a0_3;
s32 phi_t0_2;
s32 phi_v0_5;
s32 phi_v0_6;
s32 phi_v0_7;
s32 phi_v0_8;
s32 phi_v0_9;
s32 phi_a3_2;
s32 phi_t0_3;
void *phi_t4;
s32 phi_v1;
s32 phi_a3_3;
s32 phi_t0_4;
void *phi_t4_2;
s32 phi_v1_2;
s32 *phi_v1_3;
? *phi_v0_10;
s32 phi_t0_5;
s32 *phi_v0_11;
void *phi_a0_4;
s32 phi_a3_4;
s32 phi_v0_12;
s32 phi_v0_13;
phi_a0 = &gCourseCompletionPercentByRank;
phi_a3 = 1;
phi_a3_2 = 1;
phi_a3_4 = 1;
do {
temp_a3 = phi_a3 + 1;
*phi_a0 = 0.0f;
phi_a0 += 4;
phi_a3 = temp_a3;
} while (temp_a3 < 9);
phi_t0 = 0;
phi_v0 = 0;
phi_t0_2 = 0;
phi_t0_3 = 0;
phi_t0_5 = 0;
phi_a0_2 = (0 * 0xDD8) + &gPlayers;
do {
temp_v1 = phi_v0 * 4;
phi_v0_2 = phi_v0;
if ((phi_a0_2->unk0 & 0x800) != 0) {
*(&sp68 + temp_v1) = phi_t0;
*(&gCourseCompletionPercentByRank + temp_v1) = -*(&gTimePlayerLastTouchedFinishLine + (phi_t0 * 4));
phi_v0_2 = phi_v0 + 1;
}
temp_v1_2 = phi_v0_2 * 4;
phi_v0_3 = phi_v0_2;
if ((phi_a0_2->unkDD8 & 0x800) != 0) {
*(&sp68 + temp_v1_2) = phi_t0 + 1;
*(&gCourseCompletionPercentByRank + temp_v1_2) = -(&gTimePlayerLastTouchedFinishLine + (phi_t0 * 4))->unk4;
phi_v0_3 = phi_v0_2 + 1;
}
temp_v1_3 = phi_v0_3 * 4;
phi_v0_4 = phi_v0_3;
if ((phi_a0_2->unk1BB0 & 0x800) != 0) {
*(&sp68 + temp_v1_3) = phi_t0 + 2;
*(&gCourseCompletionPercentByRank + temp_v1_3) = -(&gTimePlayerLastTouchedFinishLine + (phi_t0 * 4))->unk8;
phi_v0_4 = phi_v0_3 + 1;
}
temp_v1_4 = phi_v0_4 * 4;
phi_v0_9 = phi_v0_4;
if ((phi_a0_2->unk2988 & 0x800) != 0) {
*(&sp68 + temp_v1_4) = phi_t0 + 3;
*(&gCourseCompletionPercentByRank + temp_v1_4) = -(&gTimePlayerLastTouchedFinishLine + (phi_t0 * 4))->unkC;
phi_v0_9 = phi_v0_4 + 1;
}
temp_t0 = phi_t0 + 4;
phi_a0_2 += 0x3760;
phi_t0 = temp_t0;
phi_v0 = phi_v0_9;
phi_v0_5 = phi_v0_9;
} while (temp_t0 != 8);
phi_a0_3 = (0 * 0xDD8) + &gPlayers;
do {
temp_v1_5 = phi_v0_5 * 4;
phi_v0_6 = phi_v0_5;
if ((phi_a0_3->unk0 & 0x800) == 0) {
*(&sp68 + temp_v1_5) = phi_t0_2;
*(&gCourseCompletionPercentByRank + temp_v1_5) = *(&gCourseCompletionPercentByPlayerId + (phi_t0_2 * 4));
phi_v0_6 = phi_v0_5 + 1;
}
temp_v1_6 = phi_v0_6 * 4;
phi_v0_7 = phi_v0_6;
if ((phi_a0_3->unkDD8 & 0x800) == 0) {
*(&sp68 + temp_v1_6) = phi_t0_2 + 1;
*(&gCourseCompletionPercentByRank + temp_v1_6) = (&gCourseCompletionPercentByPlayerId + (phi_t0_2 * 4))->unk4;
phi_v0_7 = phi_v0_6 + 1;
}
temp_v1_7 = phi_v0_7 * 4;
phi_v0_8 = phi_v0_7;
if ((phi_a0_3->unk1BB0 & 0x800) == 0) {
*(&sp68 + temp_v1_7) = phi_t0_2 + 2;
*(&gCourseCompletionPercentByRank + temp_v1_7) = (&gCourseCompletionPercentByPlayerId + (phi_t0_2 * 4))->unk8;
phi_v0_8 = phi_v0_7 + 1;
}
temp_v1_8 = phi_v0_8 * 4;
phi_v0_5 = phi_v0_8;
if ((phi_a0_3->unk2988 & 0x800) == 0) {
*(&sp68 + temp_v1_8) = phi_t0_2 + 3;
*(&gCourseCompletionPercentByRank + temp_v1_8) = (&gCourseCompletionPercentByPlayerId + (phi_t0_2 * 4))->unkC;
phi_v0_5 = phi_v0_8 + 1;
}
temp_t0_2 = phi_t0_2 + 4;
phi_a0_3 += 0x3760;
phi_t0_2 = temp_t0_2;
} while (temp_t0_2 != 8);
temp_t5 = phi_v0_9 - 1;
if (temp_t5 > 0) {
do {
phi_v0_12 = phi_a3_2;
if (phi_a3_2 < phi_v0_9) {
temp_a1 = phi_t0_3 * 4;
temp_a0 = temp_a1 + &gCourseCompletionPercentByRank;
if (((phi_v0_9 - phi_a3_2) & 1) != 0) {
temp_v1_9 = phi_a3_2 * 4;
temp_t4 = temp_v1_9 + &gCourseCompletionPercentByRank;
temp_f2 = *temp_t4;
temp_f0 = *temp_a0;
temp_t0_3 = &sp68 + temp_v1_9;
temp_v0 = &sp68 + temp_a1;
if (temp_f0 < temp_f2) {
temp_s0 = *temp_v0;
*temp_a0 = temp_f2;
*temp_v0 = *temp_t0_3;
*temp_t4 = temp_f0;
*temp_t0_3 = temp_s0;
}
temp_v0_2 = phi_a3_2 + 1;
phi_v0_12 = temp_v0_2;
if (temp_v0_2 != phi_v0_9) {
goto block_41;
}
} else {
block_41:
temp_v1_10 = phi_v0_12 * 4;
phi_t4 = temp_v1_10 + &gCourseCompletionPercentByRank;
phi_v1 = temp_v1_10;
do {
temp_f0_2 = *temp_a0;
temp_f2_2 = phi_t4->unk0;
temp_v0_3 = &sp68 + temp_a1;
temp_t0_4 = &sp68 + phi_v1;
if (temp_f0_2 < temp_f2_2) {
temp_s0_2 = *temp_v0_3;
temp_f12 = temp_f0_2;
*temp_a0 = temp_f2_2;
phi_t4->unk0 = temp_f12;
*temp_v0_3 = *temp_t0_4;
*temp_t0_4 = temp_s0_2;
}
temp_f2_3 = phi_t4->unk4;
temp_v0_4 = &sp68 + temp_a1;
temp_t0_5 = &sp68 + phi_v1;
if (*temp_a0 < temp_f2_3) {
temp_s0_3 = *temp_v0_4;
*temp_a0 = temp_f2_3;
*temp_v0_4 = temp_t0_5->unk4;
phi_t4->unk4 = *temp_a0;
temp_t0_5->unk4 = temp_s0_3;
}
temp_t4_2 = phi_t4 + 8;
phi_t4 = temp_t4_2;
phi_v1 += 8;
} while (temp_t4_2 != ((phi_v0_9 * 4) + &gCourseCompletionPercentByRank));
}
}
phi_a3_2 += 1;
phi_t0_3 = phi_a3_2;
} while (phi_a3_2 != temp_t5);
}
phi_t0_4 = phi_v0_9;
if (temp_t5 < 6) {
phi_a3_3 = phi_v0_9 + 1;
do {
phi_v0_13 = phi_a3_3;
if (phi_a3_3 < 8) {
temp_a1_2 = phi_t0_4 * 4;
temp_a0_2 = temp_a1_2 + &gCourseCompletionPercentByRank;
if (((8 - phi_a3_3) & 1) != 0) {
temp_v1_11 = phi_a3_3 * 4;
temp_t4_3 = temp_v1_11 + &gCourseCompletionPercentByRank;
temp_f2_4 = *temp_t4_3;
temp_f0_3 = *temp_a0_2;
temp_t0_6 = &sp68 + temp_v1_11;
temp_v0_5 = &sp68 + temp_a1_2;
if (temp_f0_3 < temp_f2_4) {
temp_s0_4 = *temp_v0_5;
*temp_a0_2 = temp_f2_4;
*temp_v0_5 = *temp_t0_6;
*temp_t4_3 = temp_f0_3;
*temp_t0_6 = temp_s0_4;
}
temp_v0_6 = phi_a3_3 + 1;
phi_v0_13 = temp_v0_6;
if (temp_v0_6 != 8) {
goto block_55;
}
} else {
block_55:
temp_v1_12 = phi_v0_13 * 4;
phi_t4_2 = temp_v1_12 + &gCourseCompletionPercentByRank;
phi_v1_2 = temp_v1_12;
do {
temp_f0_4 = *temp_a0_2;
temp_f2_5 = phi_t4_2->unk0;
temp_v0_7 = &sp68 + temp_a1_2;
temp_t0_7 = &sp68 + phi_v1_2;
if (temp_f0_4 < temp_f2_5) {
temp_s0_5 = *temp_v0_7;
temp_f12_2 = temp_f0_4;
*temp_a0_2 = temp_f2_5;
phi_t4_2->unk0 = temp_f12_2;
*temp_v0_7 = *temp_t0_7;
*temp_t0_7 = temp_s0_5;
}
temp_f2_6 = phi_t4_2->unk4;
temp_v0_8 = &sp68 + temp_a1_2;
temp_t0_8 = &sp68 + phi_v1_2;
if (*temp_a0_2 < temp_f2_6) {
temp_s0_6 = *temp_v0_8;
*temp_a0_2 = temp_f2_6;
*temp_v0_8 = temp_t0_8->unk4;
phi_t4_2->unk4 = *temp_a0_2;
temp_t0_8->unk4 = temp_s0_6;
}
temp_t4_4 = phi_t4_2 + 8;
phi_t4_2 = temp_t4_4;
phi_v1_2 += 8;
} while (temp_t4_4 != ((8 * 4) + &gCourseCompletionPercentByRank));
}
}
phi_a3_3 += 1;
phi_t0_4 = phi_a3_3;
} while (phi_a3_3 != 7);
}
phi_v1_3 = gPlayerPositions;
phi_v0_10 = &D_801643E0;
do {
temp_v1_13 = phi_v1_3 + 4;
temp_v0_9 = phi_v0_10 + 4;
temp_v0_9->unk-4 = *phi_v1_3;
phi_v1_3 = temp_v1_13;
phi_v0_10 = temp_v0_9;
} while (temp_v1_13 < &D_801643D8);
phi_v0_11 = (0 * 4) + &sp68;
phi_a0_4 = (0 * 2) + &D_80164360;
do {
temp_v1_14 = *phi_v0_11;
temp_v0_10 = phi_v0_11 + 0x10;
temp_a0_3 = phi_a0_4 + 8;
gPlayerPositions[temp_v1_14] = phi_t0_5;
temp_a1_3 = temp_v0_10->unk-C;
temp_a0_3->unk-8 = temp_v1_14;
gPlayerPositions[temp_a1_3] = phi_a3_4;
temp_a2 = temp_v0_10->unk-8;
temp_t0_9 = phi_t0_5 + 4;
gPlayerPositions[temp_a2] = phi_t0_5 + 2;
temp_t1 = temp_v0_10->unk-4;
temp_a0_3->unk-6 = temp_a1_3;
gPlayerPositions[temp_t1] = phi_t0_5 + 3;
temp_a0_3->unk-4 = temp_a2;
temp_a0_3->unk-2 = temp_t1;
phi_t0_5 = temp_t0_9;
phi_v0_11 = temp_v0_10;
phi_a0_4 = temp_a0_3;
phi_a3_4 += 4;
} while (temp_t0_9 != 8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800074D4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80007BF8(u16 arg0, s32 arg1, s32 arg2, s32 arg3, u16 arg4) {
s32 temp_t6;
s32 temp_t7;
s32 temp_t8;
? phi_v1;
temp_t6 = arg1 & 0xFFFF;
temp_t7 = arg2 & 0xFFFF;
temp_t8 = arg3 & 0xFFFF;
phi_v1 = 0;
if ((temp_t6 >= temp_t7) && (temp_t6 < (arg4 - temp_t8))) {
if ((arg0 >= (temp_t6 - temp_t7)) && ((temp_t6 + temp_t8) >= arg0)) {
return 1;
}
// Duplicate return node #9. Try simplifying control flow for better match
return phi_v1;
}
if ((((temp_t6 + temp_t8) % arg4) < arg0) && ((((temp_t6 + arg4) - temp_t7) % arg4) >= arg0)) {
return -1;
}
phi_v1 = 2;
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80007BF8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80030FC8(void *, void *, s32, s32); // extern
? func_80031F48(void *, ?, void *, s32); // extern
extern ? D_801631E0;
extern u16 D_80163344;
extern s16 D_80163478;
extern ? D_801634C0;
extern ? D_80164450;
void func_80007D04(s32 arg0, void *arg1) {
s32 sp1C;
s16 temp_t1;
s16 temp_t2;
s16 temp_v1;
s32 temp_a3;
s32 temp_v0;
s32 temp_v1_2;
s32 phi_v0;
s16 phi_t5;
s16 *phi_at;
temp_v1 = D_80163478;
temp_a3 = arg0;
temp_t1 = (&D_80164450 + (temp_v1 * 4))->unk2;
temp_t2 = (&D_80164450 + (arg0 * 4))->unk2;
if (gPlayerPositions[arg0] < 2) {
if (((temp_t2 - temp_t1) >= 0x191) && (gPlayerPositions[temp_v1].unk2 >= 6)) {
arg1->unkBC = arg1->unkBC & 0xFFDFFFFF;
arg0 = temp_a3;
func_80030FC8(arg1, arg1, temp_a3);
phi_t5 = 4;
phi_at = &D_801634C0 + (arg0 * 2);
goto block_25;
}
temp_v1_2 = gCCSelection;
if (temp_v1_2 != CC_50) {
if (temp_v1_2 != CC_100) {
if (temp_v1_2 != CC_150) {
if (temp_v1_2 != CC_EXTRA) {
phi_v0 = 0;
} else {
phi_v0 = 8;
if (temp_a3 == D_80163344) {
goto block_17;
}
}
} else {
phi_v0 = 0x12;
if (temp_a3 == D_80163344) {
phi_v0 = 0x24;
}
}
} else {
phi_v0 = 8;
if (temp_a3 == D_80163344) {
block_17:
phi_v0 = 0x18;
}
}
} else {
phi_v0 = 0;
if (temp_a3 == D_80163344) {
phi_v0 = 0x14;
}
}
if (temp_t2 < temp_t1) {
arg1->unkBC = arg1->unkBC | 0x200000;
arg0 = temp_a3;
func_80030FC8(arg1, 3, arg1, temp_a3);
*(&D_801634C0 + (arg0 * 2)) = 1;
return;
}
temp_v0 = temp_a3 * 2;
if (temp_t2 < (temp_t1 + phi_v0 + 0x32)) {
arg1->unkBC = arg1->unkBC & 0xFFDFFFFF;
arg0 = temp_a3;
func_80030FC8(arg1, 3, arg1, temp_a3);
*(&D_801634C0 + (arg0 * 2)) = 3;
return;
}
if (*(&D_801631E0 + temp_v0) == 0) {
arg1->unkBC = arg1->unkBC & 0xFFDFFFFF;
sp1C = temp_v0;
func_80030FC8(arg1, 3, arg1, temp_a3);
*(&D_801634C0 + temp_v0) = 2;
return;
}
arg1->unkBC = arg1->unkBC & 0xFFDFFFFF;
sp1C = temp_v0;
func_80031F48(arg1, 0x3F800000, arg1, temp_a3);
phi_t5 = -1;
phi_at = &D_801634C0 + temp_v0;
block_25:
*phi_at = phi_t5;
return;
}
arg1->unkBC = arg1->unkBC | 0x200000;
arg0 = temp_a3;
func_80030FC8(arg1, arg1, temp_a3);
*(&D_801634C0 + (arg0 * 2)) = 3;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80007D04.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80031F48(f32, f32, void *, ?, void *, s16); // extern
? func_80038BE4(f32, f32, void *, ?, void *, s16); // extern
extern f64 D_800ECF78;
extern f64 D_800ECF80;
extern f64 D_800ECF88;
extern f32 D_800ECF90;
extern f32 D_800ECF94;
extern f32 D_800ECF98;
extern ? D_80163410;
extern ? D_80163418;
extern ? D_80163438;
void func_80007FA4(s32 arg0, void *arg1, f32 arg2) {
f32 temp_f0;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f2;
s16 *temp_v0_2;
s16 *temp_v0_3;
s16 *temp_v0_4;
s16 *temp_v0_5;
s16 temp_v1;
s32 temp_v0;
temp_v0 = arg0 * 4;
temp_f0 = *(&D_80163418 + temp_v0) - arg1->unk14;
temp_f2 = *(&D_80163438 + temp_v0) - arg1->unk1C;
if (arg0 == 3) {
temp_v0_2 = (arg0 * 2) + &D_80163410;
temp_f12 = (temp_f0 * temp_f0) + (temp_f2 * temp_f2);
if ((temp_f12 < 25.0f) && (*temp_v0_2 < 5)) {
*temp_v0_2 = 4;
if (arg2 < D_800ECF78) {
func_80038BE4(temp_f12, arg2, arg1, 1, arg1, 3);
return;
}
func_80031F48(temp_f12, arg2, arg1, 0x3F800000, arg1, 3);
return;
}
temp_v0_3 = (arg0 * 2) + &D_80163410;
if ((temp_f12 < 3600.0f) && (*temp_v0_3 < 4)) {
*temp_v0_3 = 3;
if (arg2 < D_800ECF80) {
func_80038BE4(temp_f12, arg2, arg1, 1, arg1, 3);
return;
}
func_80031F48(temp_f12, arg2, arg1, 0x40A00000, arg1, 3);
return;
}
if (arg2 < D_800ECF88) {
func_80038BE4(temp_f12, arg2, arg1, 0xA, arg1, 3);
return;
}
func_80031F48(temp_f12, arg2, arg1, 0x3F800000, arg1, 3);
return;
}
temp_v0_4 = (arg0 * 2) + &D_80163410;
temp_f12_2 = (temp_f0 * temp_f0) + (temp_f2 * temp_f2);
if ((temp_f12_2 < 25.0f) && (*temp_v0_4 < 5)) {
*temp_v0_4 = 4;
if (arg2 < ((2.0 * 18.0) / 216.0)) {
func_80038BE4(temp_f12_2, arg2, arg1, 1, arg1, 3);
return;
}
func_80031F48(temp_f12_2, arg2, arg1, 0x3F800000, arg1, 3);
return;
}
temp_v0_5 = (arg0 * 2) + &D_80163410;
temp_v1 = *temp_v0_5;
if ((temp_f12_2 < D_800ECF90) && (temp_v1 < 4)) {
*temp_v0_5 = 3;
if (arg2 < ((5.0 * 18.0) / 216.0)) {
func_80038BE4(temp_f12_2, arg2, arg1, 1, arg1, 3);
return;
}
func_80031F48(temp_f12_2, arg2, arg1, 0x41700000, arg1, 3);
return;
}
if ((temp_f12_2 < D_800ECF94) && (temp_v1 < 3)) {
*temp_v0_5 = 2;
if (arg2 < ((20.0 * 18.0) / 216.0)) {
func_80038BE4(temp_f12_2, arg2, arg1, 5, arg1, 3);
return;
}
func_80031F48(temp_f12_2, arg2, arg1, 0x3F800000, arg1, 3);
return;
}
if ((temp_f12_2 < D_800ECF98) && (temp_v1 < 2)) {
*temp_v0_5 = 1;
if (arg2 < ((30.0 * 18.0) / 216.0)) {
func_80038BE4(temp_f12_2, arg2, arg1, 6, arg1, 3);
return;
}
func_80031F48(temp_f12_2, arg2, arg1, 0x3F800000, arg1, 3);
return;
}
if (temp_v1 == 0) {
if (arg2 < ((0x23 * 18.0) / 216.0)) {
func_80038BE4(temp_f12_2, arg2, arg1, 2, arg1, 3);
return;
}
func_80031F48(temp_f12_2, arg2, arg1, 0x3F800000, arg1, 3);
return;
}
func_80031F48(temp_f12_2, arg2, arg1, 0x3F800000, arg1, 3);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80007FA4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80007D04(f32, s32, void *, s32, void *); // extern
? func_80007FA4(f32, void *, f32, void *); // extern
s32 func_800088D8(f32, s32, s16, s16, void *); // extern
? func_80030FC8(f32, void *, void *, s32, void *); // extern
? func_80031F48(f32, void *, ?, s32, void *); // extern
extern f32 D_800ECF9C;
extern f32 D_800ECFA0;
extern ? D_801631E0;
extern ? D_80163330;
extern ? D_80163350;
extern ? D_801634D8;
extern ? D_80164392;
extern ? D_8016440A;
void func_80008424(s32 arg0, f32 arg1, void *arg2) {
f32 sp34;
void *sp28;
s32 sp1C;
f32 temp_f12;
f32 temp_f2;
s32 temp_t5;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s32 temp_v0_5;
s32 temp_v1;
u16 temp_v0_4;
void *temp_a0;
void *temp_a3;
f32 phi_f0;
void *phi_a1;
f32 phi_f12;
void *phi_a3;
temp_v1 = arg2->unkBC;
temp_f12 = arg1;
temp_a3 = arg2;
temp_f2 = arg2->unk94;
phi_a3 = temp_a3;
phi_f12 = temp_f12;
phi_f12 = temp_f12;
if (((temp_v1 & 0x80) == 0) && ((temp_v1 & 0x40) == 0) && ((temp_v1 << 0xE) >= 0) && (temp_v0 = arg2->unkC, ((temp_v0 << 9) >= 0)) && ((temp_v0 << 7) >= 0) && ((temp_v0 & 2) == 0) && ((temp_v0 & 4) == 0)) {
if (gCurrentCourseId == 0x14) {
func_80007FA4(temp_f12, arg2, temp_f2, temp_a3);
return;
}
temp_t5 = arg0 * 2;
if ((*(&D_801634D8 + temp_t5) == 1) && (temp_a0 = temp_a3, ((temp_v1 & 0x80000200) == 0))) {
arg2 = temp_a3;
func_80031F48(temp_f12, temp_a0, 0x41200000, temp_t5, temp_a3);
if (arg2->unk9C == 0.0) {
arg2->unk34 = 0.0f;
arg2->unk3C = 0.0f;
return;
}
// Duplicate return node #55. Try simplifying control flow for better match
return;
}
temp_v0_2 = gCCSelection;
phi_f0 = D_800ECF9C;
if (temp_v0_2 != CC_50) {
if (temp_v0_2 != CC_100) {
if (temp_v0_2 != CC_150) {
if (temp_v0_2 != CC_EXTRA) {
}
} else {
phi_f0 = 3.75f;
}
}
} else {
phi_f0 = 2.5f;
}
if (temp_f2 < phi_f0) {
temp_a3->unkBC = temp_v1 & 0xFFDFFFFF;
func_80030FC8(temp_f12, temp_a3, arg2, temp_t5, temp_a3);
return;
}
if ((temp_a3->unk0 & 0x800) != 0) {
if (temp_f2 < temp_f12) {
temp_a3->unkBC = temp_v1 & 0xFFDFFFFF;
func_80030FC8(temp_f12, temp_a3, arg2, temp_t5, temp_a3);
return;
}
temp_a3->unkBC = temp_v1 & 0xFFDFFFFF;
func_80031F48(temp_f12, temp_a3, 0x3F800000, temp_t5, temp_a3);
return;
}
if ((*(&D_801631E0 + temp_t5) == 1) && (*(&D_80163330 + temp_t5) != 1)) {
temp_v0_3 = arg0 * 4;
arg2 = temp_a3;
if (func_800088D8(temp_f12, arg0, *(&D_80164392 + temp_v0_3), *(&D_8016440A + temp_v0_3), temp_a3) == 1) {
arg2->unkBC = arg2->unkBC | 0x200000;
func_80030FC8((bitwise f32) arg2);
return;
}
arg2->unkBC = arg2->unkBC & 0xFFDFFFFF;
func_80031F48((bitwise f32) arg2, 0x3F800000);
return;
}
temp_v0_4 = *(&D_80163350 + temp_t5);
phi_a1 = 1;
if (temp_v0_4 != 0) {
if (temp_v0_4 != 1) {
if (temp_v0_4 != 2) {
if (temp_v0_4 != 3) {
goto block_41;
}
temp_a3->unkBC = temp_v1 | 0x200000;
arg1 = temp_f12;
sp34 = temp_f2;
arg2 = temp_a3;
sp1C = temp_t5;
sp28 = 1;
func_80030FC8(temp_f12, temp_a3, 1, temp_t5, temp_a3);
phi_f12 = arg1;
phi_a3 = arg2;
} else {
if (((temp_f2 / 18.0f) * 216.0f) > 20.0f) {
phi_f12 = D_800ECFA0;
}
goto block_41;
}
} else {
temp_a3->unkBC = temp_v1 & 0xFFDFFFFF;
arg1 = temp_f12;
sp34 = temp_f2;
arg2 = temp_a3;
sp1C = temp_t5;
sp28 = 1;
func_80030FC8(temp_f12, temp_a3, 1, temp_t5, temp_a3);
phi_f12 = arg1;
phi_a3 = arg2;
}
} else {
block_41:
phi_a1 = NULL;
}
if (phi_a1 != 1) {
if (arg2->unk94 < phi_f12) {
if ((D_800DC51C == 1) && (gCurrentCourseId != 0x14)) {
func_80030FC8(phi_f12, phi_a3, phi_a1, arg0 * 2, phi_a3);
return;
}
temp_v0_5 = arg0 * 4;
if (*(&D_80163330 + (arg0 * 2)) == 1) {
func_80007D04(phi_f12, arg0, phi_a3, arg0 * 2, phi_a3);
return;
}
arg2 = phi_a3;
if (func_800088D8(phi_f12, arg0, *(&D_80164392 + temp_v0_5), *(&D_8016440A + temp_v0_5), phi_a3) == 1) {
arg2->unkBC = arg2->unkBC | 0x200000;
func_80030FC8((bitwise f32) arg2);
return;
}
arg2->unkBC = arg2->unkBC & 0xFFDFFFFF;
func_80031F48((bitwise f32) arg2, 0x3F800000);
return;
}
phi_a3->unkBC = phi_a3->unkBC & 0xFFDFFFFF;
if (phi_f12 > 1.0f) {
func_80031F48(phi_f12, phi_a3, 0x40000000, arg0 * 2, phi_a3);
return;
}
func_80031F48(phi_f12, phi_a3, 0x40A00000, arg0 * 2, phi_a3);
// Duplicate return node #55. Try simplifying control flow for better match
return;
}
// Duplicate return node #55. Try simplifying control flow for better match
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80008424.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_800DCBB4;
extern ? D_80163128;
extern ? D_80163150;
extern ? D_80163330;
extern s16 D_80163344;
extern ? D_80163348;
extern s16 D_80163478;
extern ? D_80164376;
extern s16 D_80164386;
extern ? D_801643BA;
extern ? D_80164450;
extern ? gLapCompletionPercentByPlayerId;
extern ? D_80164538;
extern u16 D_801645C8;
extern ? gPlayers;
? func_800088D8(s32 arg0, s16 arg1, s16 arg2) {
s32 sp10;
s32 *sp4;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
s16 *temp_a0;
s16 temp_t1_3;
s16 temp_t5_2;
s16 temp_v0;
s32 *temp_t4;
s32 *temp_t5;
s32 *temp_v1;
s32 temp_a1;
s32 temp_a2;
s32 temp_lo;
s32 temp_t0;
s32 temp_t2;
s32 temp_t3;
s32 temp_t8;
s32 temp_t9;
s8 temp_t1_2;
void *temp_a2_2;
void *temp_a3;
void *temp_t1;
s16 phi_a1;
s32 phi_a0;
s32 phi_a1_2;
s32 phi_a1_3;
s32 phi_a0_2;
s32 phi_a1_4;
s16 *phi_a0_3;
s32 *phi_v1;
s32 phi_v0;
s32 phi_a0_4;
s32 phi_t1;
s32 phi_a1_5;
s32 phi_a0_5;
s32 phi_v0_2;
s32 phi_a0_6;
s32 phi_a0_7;
temp_t0 = arg0 * 4;
temp_t5 = temp_t0 + &D_80163128;
temp_t4 = temp_t0 + &D_80163150;
*temp_t5 = -1;
*temp_t4 = -1;
phi_a1 = arg1;
if (gModeSelection == TIME_TRIALS) {
return 1;
}
if (arg1 < 0) {
return 1;
}
temp_t3 = arg0 * 2;
if (arg1 >= 4) {
phi_a1 = 3;
}
if (*(&D_80163330 + temp_t3) == 1) {
return 1;
}
temp_t1 = (arg0 * 0xDD8) + &gPlayers;
if ((temp_t1->unk0 & 0x4000) != 0) {
return 1;
}
temp_t2 = phi_a1 * 8;
temp_a3 = *(&D_800DCBB4 + (gCurrentCourseId * 4)) + (temp_t2 * 2);
if (arg2 == 0) {
if (D_800DC51C == 1) {
temp_a2 = (&D_80164450 + temp_t0)->unk2 - (&D_80164450 + (D_80164386 * 4))->unk2;
phi_a1_2 = temp_a2;
if (temp_a2 < 0) {
phi_a1_2 = -temp_a2;
}
if (temp_t2 < 0x18) {
temp_f0 = *(&gLapCompletionPercentByPlayerId + temp_t0);
phi_a0 = (temp_a3->unk10 * temp_f0) + (temp_a3->unk0 * (1.0f - temp_f0));
} else {
phi_a0 = temp_a3->unk0;
}
*temp_t4 = phi_a0;
if ((phi_a0 < phi_a1_2) && (((temp_t1->unk94 / 18.0f) * 216.0f) >= 20.0f)) {
goto block_55;
}
return 1;
}
temp_v0 = (&D_80164450 + temp_t0)->unk2;
temp_t9 = D_80163478 * 4;
temp_a1 = temp_v0 - (&D_80164450 + temp_t9)->unk2;
temp_t5_2 = *(&D_801643BA + temp_t9);
phi_a1_3 = temp_a1;
if ((((D_801645C8 * 2) / 3) < temp_a1) && (temp_t5_2 >= 6)) {
phi_a1_3 = temp_v0 - (&D_80164450 + (*(&D_80164376 + (temp_t5_2 * 2)) * 4))->unk2;
}
phi_a1_4 = phi_a1_3;
if (phi_a1_3 < 0) {
phi_a1_4 = -phi_a1_3;
}
if (temp_t2 < 0x18) {
temp_f0_2 = *(&gLapCompletionPercentByPlayerId + temp_t0);
phi_a0_2 = (temp_a3->unk10 * temp_f0_2) + (temp_a3->unk0 * (1.0f - temp_f0_2));
} else {
phi_a0_2 = temp_a3->unk0;
}
temp_lo = (gCCSelection + 1) * phi_a0_2;
*temp_t4 = temp_lo;
if ((temp_lo < phi_a1_4) && (((temp_t1->unk94 / 18.0f) * 216.0f) >= 20.0f)) {
goto block_55;
}
return 1;
}
temp_t8 = (&D_80164450 + (D_80163344 * 4))->unk2 - (&D_80164450 + temp_t0)->unk2;
sp10 = temp_t8;
phi_a0_3 = &D_80163344;
phi_a1_5 = temp_t8;
if (temp_t8 < 0) {
phi_a1_5 = -temp_t8;
}
phi_v0_2 = 0;
do {
temp_a0 = phi_a0_3 + 2;
phi_a0_3 = temp_a0;
phi_v0 = phi_v0_2;
if (gPlayerPositions[*phi_a0_3] < arg2) {
phi_v0 = phi_v0_2 + 1;
}
phi_v0_2 = phi_v0;
} while (temp_a0 < &D_80163348);
temp_t1_2 = D_8018EDF3;
phi_v1 = gPlayerPositions;
phi_a0_4 = 0;
phi_a0_7 = 0;
if (temp_t1_2 > ZERO_PLAYERS_SELECTED) {
sp4 = &gPlayerPositions[temp_t1_2];
do {
phi_a0_6 = phi_a0_7;
if (*phi_v1 < arg2) {
phi_a0_6 = phi_a0_7 + 1;
}
temp_v1 = phi_v1 + 4;
phi_v1 = temp_v1;
phi_a0_4 = phi_a0_6;
phi_a0_7 = phi_a0_6;
} while (temp_v1 < sp4);
}
temp_t1_3 = (arg2 - phi_v0) - phi_a0_4;
phi_t1 = temp_t1_3;
if ((phi_v0 > 0) || (phi_a0_4 > 0)) {
phi_t1 = temp_t1_3 + 1;
}
*(&D_80164538 + temp_t3) = phi_t1;
if ((phi_t1 < 0) || (phi_t1 >= 8)) {
goto block_55;
}
if (temp_t2 < 0x18) {
temp_a2_2 = temp_a3 + (phi_t1 * 2);
temp_f0_3 = *(&gLapCompletionPercentByPlayerId + temp_t0);
phi_a0_5 = (temp_a2_2->unk10 * temp_f0_3) + (temp_a2_2->unk0 * (1.0f - temp_f0_3));
} else {
phi_a0_5 = *(temp_a3 + (phi_t1 * 2));
}
*temp_t5 = phi_a1_5;
*temp_t4 = phi_a0_5;
if (phi_a0_5 < phi_a1_5) {
return 1;
}
block_55:
return 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800088D8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_801631D0;
extern s32 D_801631D4;
extern s32 D_801631D8;
extern s32 D_801631DC;
extern u16 D_80164430;
extern s16 *D_80164490;
extern ? D_80164560;
extern ? D_80164570;
extern ? D_80164580;
extern ? D_80164590;
extern ? D_801645A0;
extern ? D_801645C8;
extern s32 D_801645E0;
void func_80008DC0(s32 arg0) {
s32 temp_v0;
temp_v0 = arg0 * 4;
D_80164490 = (&D_80164550)[arg0];
D_801631D0 = *(&D_80164560 + temp_v0);
D_801631D4 = *(&D_80164570 + temp_v0);
D_801631D8 = *(&D_80164580 + temp_v0);
D_801631DC = *(&D_80164590 + temp_v0);
D_801645E0 = *(&D_801645A0 + temp_v0);
D_80164430 = *(&D_801645C8 + (arg0 * 2));
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80008DC0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80008DC0(s32, s32); // extern
s16 func_8000C0BC(f32, f32, s32, ?32, s32, s32 *); // extern
s16 func_802ABD40(u16); // extern
extern s16 D_80162FCE;
extern ? D_80163318;
extern ? D_80164438;
extern ? D_801645B0;
extern ? gPlayers;
s32 func_80008E58(s32 arg0, s32 arg1) {
f32 sp3C;
f32 sp38;
?32 sp34;
s32 sp28;
s32 sp24;
s16 temp_v0_2;
s32 temp_a0;
s32 temp_t9;
void *temp_v0;
temp_v0 = (arg0 * 0xDD8) + &gPlayers;
sp28 = arg1;
sp3C = temp_v0->unk14;
sp38 = temp_v0->unk18;
sp34 = temp_v0->unk1C;
temp_v0_2 = func_802ABD40(temp_v0->unk11A);
temp_t9 = arg0 * 2;
*(&D_80163318 + temp_t9) = temp_v0_2;
sp24 = temp_t9;
D_80162FCE = func_8000C0BC(sp3C, sp38, arg0, sp34, temp_v0_2 & 0xFFFF, &arg1);
temp_a0 = arg1;
*(&D_80164438 + sp24) = D_80162FCE;
*(&D_801645B0 + sp24) = temp_a0;
arg1 = temp_a0;
func_80008DC0(temp_a0, sp24);
return arg1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80008E58.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80162FCE;
extern ? D_80164438;
extern ? D_80164450;
extern ? gLapCompletionPercentByPlayerId;
extern ? gCourseCompletionPercentByPlayerId;
extern ? D_801645B0;
extern u16 D_801645C8;
extern ? gLapCountByPlayerId;
void func_80008F38(s32 arg0) {
f32 temp_f0;
f32 temp_f16;
f32 temp_f6;
s32 temp_a1;
s32 temp_v0;
s32 temp_v1;
u16 temp_t0;
u16 temp_t4;
f32 phi_f6;
f32 phi_f16;
temp_v0 = arg0 * 4;
temp_v1 = *(&gLapCountByPlayerId + temp_v0);
temp_a1 = arg0 * 2;
temp_t0 = *(&D_80164438 + temp_a1);
temp_f6 = temp_t0;
*(&D_80164450 + temp_v0) = (D_801645C8 * temp_v1) + D_80162FCE;
phi_f6 = temp_f6;
if (temp_t0 < 0) {
phi_f6 = temp_f6 + 4294967296.0f;
}
temp_t4 = *(&D_801645C8 + (*(&D_801645B0 + temp_a1) * 2));
temp_f16 = temp_t4;
phi_f16 = temp_f16;
if (temp_t4 < 0) {
phi_f16 = temp_f16 + 4294967296.0f;
}
temp_f0 = phi_f6 / phi_f16;
*(&gLapCompletionPercentByPlayerId + temp_v0) = temp_f0;
*(&gCourseCompletionPercentByPlayerId + temp_v0) = temp_f0 + temp_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80008F38.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80162FCE;
extern s32 D_80163448;
extern ? D_80163490;
extern ? D_801634A8;
extern ? D_801644F8;
void func_80009000(s32 arg0) {
s16 *temp_a1;
s16 temp_a2;
s16 temp_v0;
s32 temp_a0;
s32 temp_v1;
temp_a2 = D_80162FCE;
temp_v1 = arg0 * 2;
temp_a1 = temp_v1 + &D_801644F8;
temp_v0 = *temp_a1;
if (temp_a2 >= 0x6D) {
*temp_a1 = 1;
temp_a0 = D_80163448;
if (temp_a0 != 0) {
if (temp_a0 != 1) {
if (temp_a0 != 2) {
if (temp_a0 != 3) {
} else if (temp_a2 >= 0x283) {
goto block_13;
}
} else if (temp_a2 >= 0x211) {
goto block_13;
}
} else if (temp_a2 >= 0x206) {
goto block_13;
}
} else if (temp_a2 >= 0x20F) {
block_13:
*temp_a1 = 0;
}
}
if ((temp_v0 == 0) && (*temp_a1 == 1)) {
*(&D_80163490 + temp_v1) = 1;
}
if ((temp_v0 == 1) && (*temp_a1 == 0)) {
*(&D_801634A8 + temp_v1) = 1;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80009000.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80008E58(s32, s32); // extern
? func_80008F38(s32); // extern
s16 func_8000CD24(f32, f32, ?32, ?, void *, s32, s32); // extern
extern s16 D_80162FCE;
extern s32 D_80163448;
extern ? D_80163490;
extern ? D_801634A8;
extern ? D_80164438;
void func_800090F0(s32 arg0, void *arg1) {
f32 sp5C;
f32 sp58;
?32 sp54;
s16 *sp40;
s16 *sp3C;
s16 *temp_v0;
s16 *temp_v0_3;
s32 temp_s2;
s32 temp_v0_2;
sp5C = arg1->unk14;
temp_s2 = arg0 * 2;
temp_v0 = temp_s2 + &D_80163490;
sp58 = arg1->unk18;
sp54 = arg1->unk1C;
if (*temp_v0 == 1) {
sp40 = temp_v0;
temp_v0_2 = func_80008E58(arg0, random_int(4));
D_80163448 = temp_v0_2;
D_80162FCE = func_8000CD24(sp5C, sp58, sp54, 0, arg1, arg0, temp_v0_2);
*(&D_80164438 + temp_s2) = D_80162FCE;
func_80008F38(arg0);
*sp40 = 0;
}
temp_v0_3 = temp_s2 + &D_801634A8;
if (*temp_v0_3 == 1) {
sp40 = temp_s2 + &D_80164438;
sp3C = temp_v0_3;
D_80163448 = func_80008E58(arg0, 0);
D_80162FCE = func_8000CD24(sp5C, sp58, sp54, 0, arg1, arg0, D_80163448);
*sp40 = D_80162FCE;
func_80008F38(arg0);
*sp3C = 0;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800090F0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFA4;
extern f32 D_8016344C;
extern f32 gCourseTimer;
f32 func_80009258(s32 arg0, f32 arg1, f32 arg2) {
f32 temp_f12;
f32 temp_f2;
temp_f12 = D_8016344C;
temp_f2 = temp_f12 - arg2;
return gCourseTimer - ((D_800ECFA4 * temp_f2) / (temp_f2 + (arg1 - temp_f12)));
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80009258.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800065D0(s32, void *, s32 *); // extern
? func_80008F38(f32, s32, s16 *, s32 *, s16 *); // extern
? func_80009000(s32); // extern
? func_800090F0(s32, void *); // extern
f32 func_80009258(s32, f32, f32, s16 *); // extern
? func_8000B95C(f32, s32, s32, s32, s32); // extern
s16 func_8000CD24(f32, f32, f32, s16, void *, s32, s32); // extern
? func_80011AE4(s32); // extern
extern f32 D_800ECFA8;
extern f32 D_800ECFAC;
extern ? gTimePlayerLastTouchedFinishLine;
extern s16 D_80162FCE;
extern s16 D_801630E0;
extern s16 D_801630E2;
extern ? D_80163240;
extern s32 D_80163448;
extern f32 D_8016344C;
extern ? D_80163450;
extern s16 D_80163478;
extern s16 D_8016348C;
extern s16 D_801634EC;
extern ? D_801642DE;
extern ? D_801643B0;
extern s32 D_80164408;
extern s32 D_8016440C;
extern ? D_80164438;
extern ? D_801645C8;
extern ? gLapCountByPlayerId;
void func_8000929C(s32 arg0, void *arg1) {
f32 sp4C;
f32 sp44;
f32 sp38;
s16 sp34;
s16 *sp30;
s16 *sp2C;
? *temp_v0_4;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f12;
s16 *temp_t0;
s16 *temp_v1;
s16 temp_a3;
s16 temp_v0_2;
s32 *temp_v0_3;
s32 *temp_v0_5;
s32 temp_a0;
s32 temp_a0_2;
s32 temp_a0_3;
s32 temp_a1;
s32 temp_t1;
s32 temp_v0;
u16 temp_v0_6;
u16 temp_v0_7;
s32 phi_a0;
s32 phi_a3;
s16 *phi_a3_2;
s32 phi_v1;
? *phi_v0;
s16 phi_t0;
s32 phi_a0_2;
s32 phi_a0_3;
s32 phi_a0_4;
f32 phi_a0_5;
s32 phi_a2;
temp_f0 = arg1->unk1C;
temp_f12 = arg1->unk14;
temp_v0 = arg0 * 2;
D_801630E2 = 0;
temp_v1 = temp_v0 + &D_80163240;
*temp_v1 = 0;
temp_t0 = temp_v0 + &D_80164438;
sp30 = temp_t0;
sp2C = temp_v1;
sp44 = temp_f0;
sp4C = temp_f12;
D_80162FCE = func_8000CD24(temp_f12, arg1->unk18, temp_f0, *temp_t0, arg1, arg0, D_80163448);
temp_a3 = D_80162FCE;
D_801630E0 = temp_a3;
temp_a0 = arg0;
phi_a0 = temp_a0;
phi_a3 = temp_a3;
if (temp_a3 != *temp_t0) {
*temp_t0 = temp_a3;
D_801630E2 = 1;
arg0 = temp_a0;
sp4C = temp_f12;
func_80008F38(temp_f12, temp_a0, &D_80162FCE);
phi_a0 = arg0;
phi_a3 = D_80162FCE;
}
temp_v0_2 = gCurrentCourseId;
temp_a1 = phi_a3 & 0xFFFF;
phi_a0_2 = phi_a0;
phi_a0_3 = phi_a0;
if (temp_v0_2 == 0x14) {
func_8000B95C(arg1->unk14, phi_a0, temp_a1, D_80163448, phi_a3);
return;
}
if ((phi_a3 < 0x14) || ((*(&D_801645C8 + (D_80163448 * 2)) - 0x14) < phi_a3) || (temp_v0_2 == 0xB)) {
phi_v1 = 0;
phi_t0 = 0;
if (temp_v0_2 == 0xB) {
D_801634EC = 0;
if ((arg1->unkBC & 0x200) != 0) {
D_801634EC = 1;
}
if (gIsMirrorMode != 0) {
phi_a3_2 = phi_a0 * 4;
if (arg1->unk14 < 300.0f) {
phi_v1 = 1;
phi_t0 = 1;
} else if ((arg1->unk14 < D_800ECFA8) && (*(&gLapCountByPlayerId + (phi_a0 * 4)) < 2) && (phi_a3_2 = phi_a0 * 4, (D_801634EC == 1))) {
phi_v1 = 1;
phi_t0 = 1;
} else {
goto block_23;
}
} else {
phi_a3_2 = phi_a0 * 4;
if (arg1->unk14 > -300.0f) {
phi_v1 = 1;
phi_t0 = 1;
} else {
if ((D_800ECFAC < arg1->unk14) && (*(&gLapCountByPlayerId + (phi_a0 * 4)) < 2) && (D_801634EC == 1)) {
phi_v1 = 1;
phi_t0 = 1;
}
block_23:
goto block_25;
}
}
} else {
phi_v1 = 1;
phi_t0 = 1;
block_25:
phi_a3_2 = phi_a0 * 4;
}
sp38 = *(&D_80163450 + phi_a3_2);
if (phi_v1 != 0) {
temp_f0_2 = D_8016344C;
if (sp44 <= temp_f0_2) {
temp_v0_3 = phi_a3_2 + &gLapCountByPlayerId;
if (temp_f0_2 < sp38) {
temp_t1 = *temp_v0_3 + 1;
*temp_v0_3 = temp_t1;
if ((gModeSelection == GRAND_PRIX) && (temp_t1 == 5)) {
phi_v0 = &gLapCountByPlayerId;
if (*(&D_80164408 + phi_a3_2) == 7) {
do {
temp_v0_4 = phi_v0 + 0x10;
temp_v0_4->unk-4 = phi_v0->unkC - 1;
temp_v0_4->unk-8 = phi_v0->unk8 - 1;
temp_v0_4->unk-C = phi_v0->unk4 - 1;
temp_v0_4->unk-10 = phi_v0->unk0 - 1;
phi_v0 = temp_v0_4;
} while (temp_v0_4 != &D_801643B0);
}
}
*sp2C = 1;
sp34 = phi_t0;
sp30 = phi_a3_2;
arg0 = phi_a0;
func_80008F38(arg1->unk14, phi_a0, temp_a1, &D_80163448, phi_a3_2);
func_80011AE4(arg0);
temp_a0_2 = arg0;
*(&D_801642DE + (temp_a0_2 * 0x10)) = 0;
phi_a0_2 = temp_a0_2;
if ((D_8016348C == 0) && ((arg1->unk0 & 0x800) == 0)) {
arg0 = temp_a0_2;
sp30 = phi_a3_2;
sp34 = phi_t0;
*(&gTimePlayerLastTouchedFinishLine + phi_a3_2) = func_80009258(temp_a0_2, sp38, sp44, phi_a3_2);
phi_a0_2 = arg0;
}
}
}
}
phi_a0_3 = phi_a0_2;
if (phi_t0 != 0) {
temp_f0_3 = D_8016344C;
if (sp38 <= temp_f0_3) {
temp_v0_5 = phi_a3_2 + &gLapCountByPlayerId;
if (temp_f0_3 < sp44) {
arg0 = phi_a0_2;
*temp_v0_5 = *temp_v0_5 - 1;
func_80008F38((bitwise f32) phi_a0_2);
phi_a0_3 = arg0;
}
}
}
}
*(&D_80163450 + (phi_a0_3 * 4)) = sp44;
phi_a0_4 = phi_a0_3;
if ((gCurrentCourseId == 4) && (D_801630E2 == 1) && ((arg0 = phi_a0_3, func_80009000(phi_a0_3), temp_a0_3 = arg0, temp_v0_6 = arg1->unk0, phi_a0_4 = temp_a0_3, ((temp_v0_6 & 0x4000) == 0)) || ((temp_v0_6 & 0x1000) != 0))) {
arg0 = temp_a0_3;
func_800090F0(temp_a0_3, arg1);
phi_a0_4 = arg0;
}
temp_v0_7 = arg1->unk0;
phi_a0_5 = (bitwise f32) phi_a0_4;
if (((temp_v0_7 & 0x4000) != 0) && ((temp_v0_7 & 0x1000) == 0)) {
arg0 = phi_a0_4;
func_800065D0(phi_a0_4, arg1, &D_80163448);
phi_a0_5 = (bitwise f32) arg0;
if ((gModeSelection == GRAND_PRIX) && (D_8018EDF3 == TWO_PLAYERS_SELECTED) && (arg0 == 0)) {
if (D_80164408 < D_8016440C) {
D_80163478 = 0;
} else {
D_80163478 = 1;
}
}
phi_a2 = D_80163448;
} else {
phi_a2 = D_80163448;
}
func_8000B95C(phi_a0_5, D_80162FCE & 0xFFFF, phi_a2);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000929C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000DF8C(s32); // extern
? func_8000EF20(); // extern
? func_80012AC0(); // extern
? func_800133C4(); // extern
? func_8001487C(); // extern
? func_800149D0(); // extern
? func_80014B24(); // extern
? func_80014C78(); // extern
extern s32 D_8016337C;
void func_800097E0(void) {
s16 temp_v0;
s32 temp_s0;
s32 temp_s0_2;
s32 phi_s0;
s32 phi_s0_2;
s16 phi_v0;
func_8000EF20();
D_8016337C = D_8016337C + 1;
temp_v0 = gCurrentCourseId;
phi_s0 = 0;
phi_s0_2 = 0;
phi_v0 = temp_v0;
if (temp_v0 == 0x14) {
do {
func_8000DF8C(phi_s0);
temp_s0 = phi_s0 + 1;
phi_s0 = temp_s0;
} while (temp_s0 != 7);
return;
}
if ((D_8016337C & 1) != 0) {
if (gModeSelection == VERSUS) {
do {
func_8000DF8C(phi_s0_2);
temp_s0_2 = phi_s0_2 + 1;
phi_s0_2 = temp_s0_2;
} while (temp_s0_2 != 7);
phi_v0 = gCurrentCourseId;
}
if (phi_v0 != 0xA) {
if (phi_v0 != 0xB) {
if (phi_v0 != 0x12) {
return;
}
func_800133C4();
return;
}
func_80012AC0();
return;
}
func_8001487C();
func_800149D0();
func_80014B24();
func_80014C78();
// Duplicate return node #14. Try simplifying control flow for better match
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800097E0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function func_800098FC:
Label L8000994C refers to a delay slot; this is currently not supported.
Please modify the assembly to work around it (e.g. copy the instruction
to all jump sources and move the label, or add a nop to the delay slot).
*/
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800098FC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800C92CC(s32, ?); // extern
extern ? D_80163398;
extern ? D_801633B0;
extern ? D_801633C8;
extern ? D_801643E0;
void func_800099EC(s32 arg0, ? arg1) {
s32 sp40;
s16 *temp_s7;
s16 *temp_v0_2;
s16 *temp_v0_3;
s16 temp_v1_2;
s16 temp_v1_3;
s32 temp_s0;
s32 temp_t6;
s32 temp_v0;
s32 temp_v1;
s8 temp_a0;
s32 *phi_s2;
s32 phi_s1;
s32 phi_s0;
s32 phi_a0;
temp_t6 = arg0 * 2;
temp_s7 = temp_t6 + &D_801633C8;
sp40 = temp_t6;
if (*temp_s7 >= 0x65) {
temp_a0 = D_8018EDF3;
phi_s0 = 0;
phi_a0 = temp_a0;
if (temp_a0 > ZERO_PLAYERS_SELECTED) {
phi_s2 = gPlayerPositions;
phi_s1 = 0;
do {
temp_v0 = gPlayerPositions[arg0];
temp_v1 = *phi_s2;
if ((temp_v0 < temp_v1) && (temp_v0 == *(&D_801643E0 + phi_s1)) && (temp_v1 == *(&D_801643E0 + (arg0 * 4)))) {
func_800C92CC(arg0 & 0xFF, 0x2900800D);
*temp_s7 = 0;
phi_a0 = D_8018EDF3;
}
temp_s0 = phi_s0 + 1;
phi_s2 += 4;
phi_s1 += 4;
phi_s0 = temp_s0;
} while (temp_s0 < phi_a0);
}
}
if (*temp_s7 < 0x3E8) {
*temp_s7 = *temp_s7 + 1;
}
temp_v0_2 = sp40 + &D_80163398;
temp_v1_2 = *temp_v0_2;
if (temp_v1_2 < 0xC8) {
*temp_v0_2 = temp_v1_2 + 1;
}
temp_v0_3 = sp40 + &D_801633B0;
temp_v1_3 = *temp_v0_3;
if (temp_v1_3 < 0xC8) {
*temp_v0_3 = temp_v1_3 + 1;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800099EC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80008424(s32, ?32, void *); // extern
? func_80008DC0(u16, s32, s32, s32); // extern
? func_8000929C(s32, void *); // extern
? func_800099EC(s32, void *); // extern
? func_8000B140(s32); // extern
s32 func_8000B7E4(s32, u16); // extern
? func_8000BBD8(s32, ?32, s16, ? *); // extern
? func_8000D3B8(s32); // extern
? func_8000D438(s32, u16); // extern
? func_80011E38(s32); // extern
? func_80012DC0(s32, void *); // extern
? func_80013054(); // extern
? func_800131DC(s32); // extern
? func_80013854(void *); // extern
? func_800148C4(s32, void *); // extern
? func_8001490C(s32, u16 *, f32 *, u16 *); // extern
? func_80014A18(s32, void *); // extern
? func_80014A60(s32); // extern
? func_80014B6C(s32, void *); // extern
? func_80014BB4(s32); // extern
? func_80014CC0(s32, void *); // extern
? func_80014D08(s32); // extern
? func_8001AC10(s32); // extern
? func_8002E4C4(void *, u16 *, f32 *, u16 *); // extern
? func_8003680C(void *, s16, void *, s32, void *); // extern
s32 func_802B5224(void *, ? *, void *, ? *); // extern
void *segmented_to_virtual_dupe(void*); // extern
? set_places(); // extern
extern ? D_0D009418;
extern ? D_0D009568;
extern ? D_0D0096B8;
extern ? D_0D009808;
extern ? D_800DCA20;
extern ? D_800DCA4C;
extern f32 D_800ECFB0;
extern ?32 D_800ECFB4;
extern f32 D_800ECFB8;
extern f32 D_800ECFBC;
extern f32 D_800ECFC0;
extern f32 D_800ECFC4;
extern ?32 D_800ECFC8;
extern ? D_80162FA0;
extern s16 D_80162FCE;
extern s16 D_80162FD0;
extern ? D_80162FF8;
extern ? D_80163028;
extern ? D_80163050;
extern ? D_80163068;
extern ? D_80163090;
extern ? D_801630B8;
extern u16 D_801630E0;
extern s16 D_801630E2;
extern ? D_801630E8;
extern ? D_80163100;
extern ? D_80163178;
extern ? D_801631A0;
extern s32 D_801631D8;
extern s32 D_801631DC;
extern ? D_801631E0;
extern ? D_801631F8;
extern ?32 D_8016320C;
extern ? D_80163210;
extern ? D_80163240;
extern ? D_801632E8;
extern ? D_80163300;
extern ? D_80163330;
extern ? D_8016334C;
extern s32 D_80163378;
extern ? D_801633E0;
extern ? D_80163410;
extern ? D_80163418;
extern ? D_80163438;
extern s32 D_80163448;
extern s16 D_8016344A;
extern s32 D_80163488;
extern ? D_801634F8;
extern ? D_801634FC;
extern ? D_80163504;
extern u16 D_80164430;
extern ? D_80164438;
extern ? D_80164450;
extern ? gLapCompletionPercentByPlayerId;
extern ? D_801644D0;
extern ? D_80164590;
extern ? D_801645B0;
extern ? D_801645C8;
extern s32 D_801645E0;
extern u16 D_801646CC;
extern ? gPlayers;
void func_80009B60(s32 arg0) {
s16 sp94;
void *sp40;
?32 *sp3C;
s32 sp38;
s32 sp34;
s32 sp30;
u16 *sp2C;
f32 *sp28;
u16 *sp24;
u16 *sp20;
void *sp1C;
?32 *temp_t0;
?32 *temp_t0_2;
?32 *temp_t0_3;
?32 *temp_t0_4;
?32 *temp_v0_21;
?32 *temp_v0_22;
?32 *temp_v1_10;
?32 *temp_v1_11;
f32 *temp_a2_2;
f32 *temp_v0_17;
f32 *temp_v1_5;
f32 *temp_v1_7;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f0_5;
f32 temp_f2;
f32 temp_f2_2;
s16 *temp_v0_2;
s16 *temp_v1_4;
s16 temp_v0_11;
s16 temp_v0_12;
s16 temp_v0_13;
s16 temp_v0_14;
s16 temp_v0_15;
s16 temp_v0_18;
s16 temp_v0_20;
s16 temp_v0_23;
s16 temp_v0_24;
s16 temp_v0_3;
s16 temp_v0_4;
s16 temp_v0_6;
s16 temp_v0_8;
s16 temp_v1_8;
s16 temp_v1_9;
s32 *temp_v0;
s32 temp_a1;
s32 temp_a1_3;
s32 temp_a2;
s32 temp_a3;
s32 temp_f10;
s32 temp_f6;
s32 temp_lo;
s32 temp_lo_2;
s32 temp_t5;
s32 temp_t6;
s32 temp_v0_10;
s32 temp_v0_19;
s32 temp_v0_5;
s32 temp_v0_7;
s8 temp_v0_9;
u16 *temp_a1_2;
u16 *temp_a3_2;
u16 *temp_t0_5;
u16 *temp_t0_6;
u16 *temp_t6_2;
u16 *temp_t8;
u16 temp_a0;
u16 temp_a0_2;
void *temp_v0_16;
void *temp_v1;
void *temp_v1_2;
void *temp_v1_3;
void *temp_v1_6;
s32 phi_t1;
s32 phi_t1_2;
u16 phi_a0;
s32 phi_t0;
?32 *phi_t0_2;
?32 *phi_t0_3;
s16 phi_v0;
s32 phi_a0_2;
s32 phi_a1;
s32 phi_a0_3;
s32 phi_a1_2;
s32 phi_v1;
s32 phi_v1_2;
s32 phi_a2;
?32 *phi_v0_2;
s16 phi_a1_3;
s32 phi_a2_2;
s32 phi_v1_3;
s16 phi_v1_4;
temp_a3 = arg0 * 4;
temp_a1 = arg0;
temp_v0 = temp_a3 + &D_80163100;
if (*(&D_800DCA4C + (gCurrentCourseId * 4)) >= 0) {
*temp_v0 = *temp_v0 + 1;
if (arg0 == 0) {
temp_t6 = D_80163378 + 1;
D_80163378 = temp_t6;
if ((temp_t6 & 1) != 0) {
D_80163488 = D_80163488 + 1;
}
}
temp_v1 = (temp_a1 * 0xDD8) + &gPlayers;
temp_a2 = temp_a1 * 2;
if ((temp_v1->unk0 & 0x8000) == 0) {
*(&D_80164450 + temp_a3) = -0x14;
*(&gCourseCompletionPercentByPlayerId + temp_a3) = -1000.0f;
*(&gLapCompletionPercentByPlayerId + temp_a3) = -1000.0f;
return;
}
temp_v0_2 = temp_a2 + &D_801633E0;
*temp_v0_2 = 0;
if (temp_v1->unk14 < D_8015F6EA) {
*temp_v0_2 = 1;
}
if (D_8015F6E8 < temp_v1->unk14) {
*temp_v0_2 = 2;
}
if (temp_v1->unk1C < D_8015F6F2) {
*temp_v0_2 = 3;
}
if (D_8015F6F0 < temp_v1->unk1C) {
*temp_v0_2 = 4;
}
temp_v0_3 = temp_v1->unkCA;
if (((temp_v0_3 & 2) == 0) && ((temp_v0_3 & 8) == 0)) {
temp_a0 = *(&D_801645B0 + temp_a2);
sp40 = temp_v1;
arg0 = temp_a1;
sp34 = temp_a2;
sp38 = temp_a3;
D_80163448 = temp_a0;
func_80008DC0(temp_a0, temp_a1, temp_a2, temp_a3);
temp_v0_4 = gCurrentCourseId;
if (temp_v0_4 != 0xA) {
if (temp_v0_4 != 0xB) {
if (temp_v0_4 != 0x12) {
} else {
func_80013854(sp40);
}
} else {
func_80012DC0(arg0, sp40);
if (arg0 == 0) {
func_80013054();
}
}
} else {
func_800148C4(arg0, sp40);
func_80014A18(arg0, sp40);
func_80014B6C(arg0, sp40);
func_80014CC0(arg0, sp40);
}
if ((sp40->unk0 & 0x800) != 0) {
sp40->unkBC = sp40->unkBC & 0xFFBFFFFF;
sp40->unk44 = sp40->unk44 & 0xFFFE;
}
func_8000929C(arg0, sp40);
if ((gCurrentCourseId != 0x14) && ((*(&D_80163240 + sp34) == 1) || (arg0 == 0))) {
set_places();
}
if ((sp40->unk0 & 0x1000) != 0) {
if ((D_801630E2 == 1) && (gCurrentCourseId != 0x14)) {
func_80011E38(arg0);
}
temp_t5 = arg0 & 1;
sp30 = temp_t5;
if ((D_80163378 & 1) != temp_t5) {
func_8001AC10(arg0);
}
func_800099EC(arg0, sp40);
temp_v0_5 = gModeSelection;
D_80162FD0 = 0;
if (temp_v0_5 != GRAND_PRIX) {
if ((temp_v0_5 != TIME_TRIALS) && (temp_v0_5 != VERSUS) && (temp_v0_5 != BATTLE)) {
}
}
temp_a1_2 = sp34 + &D_801631E0;
*temp_a1_2 = 0;
phi_t1 = 1;
if (((sp40->unkBC & 0x1000) != 0) && (gCurrentCourseId != 0x14)) {
*temp_a1_2 = 1;
}
temp_v0_6 = gCurrentCourseId;
if ((D_801646CC == 1) || ((sp40->unk0 & 0x800) != 0) || (temp_v0_6 == 0x14)) {
if (temp_v0_6 != 0xA) {
*(&D_801634FC + (arg0 * 0x10)) = 0.0f;
}
*(&D_80163504 + (arg0 * 0x10)) = 0.0f;
}
temp_v0_7 = D_80163448;
if (temp_v0_7 > 0) {
temp_v1_2 = (arg0 * 0x10) + &D_801634F8;
temp_v1_2->unk4 = 0.0f;
temp_v1_2->unkC = 0.0f;
}
temp_t6_2 = sp34 + &D_80164438;
sp24 = temp_t6_2;
temp_a2_2 = sp38 + D_80164510;
temp_a3_2 = sp34 + &D_801631F8;
*temp_a2_2 = ((&D_80164550)[temp_v0_7] + (*temp_t6_2 * 8))->unk2 + D_800ECFB0;
if ((*temp_a3_2 == 1) && (*temp_a1_2 == 0)) {
sp2C = temp_a1_2;
sp28 = temp_a2_2;
sp20 = temp_a3_2;
func_8002E4C4(sp40, temp_a1_2, temp_a2_2, temp_a3_2);
phi_t1 = 1;
}
phi_t1_2 = phi_t1;
phi_t0 = sp34;
if (phi_t1 == *(sp34 + &D_801631E0)) {
sp40->unk18 = *(sp38 + D_80164510);
}
*(sp34 + &D_801631F8) = *(sp34 + &D_801631E0);
temp_v0_8 = gCurrentCourseId;
if (temp_v0_8 != 4) {
if (temp_v0_8 != 0xA) {
phi_a0 = *(sp34 + &D_801631E0);
if (temp_v0_8 != 0x14) {
} else {
goto block_63;
}
} else {
sp2C = sp34 + &D_801631E0;
func_8001490C(arg0, sp34 + &D_801631E0, sp38 + D_80164510, sp34 + &D_801631F8);
func_80014A60(arg0);
func_80014BB4(arg0);
func_80014D08(arg0);
phi_t1_2 = 1;
phi_a0 = *(sp34 + &D_801631E0);
phi_t0 = sp34;
}
} else {
block_63:
*(&D_801634FC + (arg0 * 0x10)) = 0.0f;
phi_a0 = *(sp34 + &D_801631E0);
}
if (phi_t1_2 == phi_a0) {
*(&D_801630E8 + phi_t0) = 0;
sp40->unkBC = sp40->unkBC & ~0x10;
if ((D_80163378 & 1) != sp30) {
func_8003680C(sp40, 0);
func_80008424(arg0, *(&D_80163210 + sp38), sp40);
return;
}
temp_v0_9 = D_8018EDF3;
if ((temp_v0_9 > ZERO_PLAYERS_SELECTED) && (temp_v0_9 < THREE_PLAYERS_SELECTED) && (phi_t1_2 == *(&D_80163330 + phi_t0)) && (*(&D_8016334C + phi_t0) < *(gPlayerPositions + sp38))) {
temp_t0 = sp38 + &D_80163210;
*temp_t0 = D_800ECFB4;
phi_t0_2 = temp_t0;
} else if (phi_t1_2 == D_80162FD0) {
temp_v1_3 = (arg0 * 0x10) + &D_801634F8;
sp30 = temp_v1_3;
temp_t0_2 = sp38 + &D_80163210;
*temp_t0_2 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D0096B8);
temp_v1_3->unk4 = -0.5f;
phi_t0_2 = temp_t0_2;
} else if (*(D_801645E0 + (D_80162FCE * 2)) > 0) {
temp_t0_3 = sp38 + &D_80163210;
*temp_t0_3 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D009418);
phi_t0_2 = temp_t0_3;
} else {
temp_t0_4 = sp38 + &D_80163210;
*temp_t0_4 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D009568);
phi_t0_2 = temp_t0_4;
}
sp3C = phi_t0_2;
func_800131DC(arg0);
func_8000D3B8(arg0);
func_8000D438(arg0, D_801630E0);
temp_v0_10 = sp40->unkBC;
temp_f0 = D_80162FA0.unk0 - sp40->unk14;
temp_f2 = D_80162FA0.unk8 - sp40->unk1C;
phi_t0_3 = phi_t0_2;
if (((temp_v0_10 & 0x80) == 0) && ((temp_v0_10 & 0x40) == 0) && ((temp_v0_10 & 0x800) == 0)) {
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) > 6400.0f) {
if (D_80163448 == 0) {
sp3C = phi_t0_2;
func_8000B140(arg0);
if (*(&D_80162FF8 + sp34) > 0) {
sp3C = phi_t0_2;
func_8000BBD8((((D_801630E0 + 5) & 0xFFFF) % D_80164430) & 0xFFFF, *(&D_80163090 + sp38), D_8016344A, &D_80162FA0);
}
}
sp3C = phi_t0_2;
sp40->unk2E = -func_802B5224(sp40 + 0x14, &D_80162FA0, sp40, &D_80162FA0);
phi_t0_3 = phi_t0_2;
} else {
sp40->unk2E = *(*(&D_80164590 + (D_80163448 * 4)) + (((D_801630E0 + 4) % D_80164430) * 2));
}
}
sp3C = phi_t0_3;
func_8003680C(sp40, 0, sp40);
func_80008424(arg0, *phi_t0_3, sp40);
return;
}
temp_t8 = phi_t0 + &D_801630E8;
sp2C = temp_t8;
temp_v0_11 = *temp_t8;
phi_v0 = temp_v0_11;
if ((phi_t1_2 == temp_v0_11) || (temp_v0_11 == -1)) {
sp40->unkBC = sp40->unkBC | 0x10;
phi_v0 = *sp2C;
}
if (phi_v0 != 0) {
temp_v1_4 = sp34 + &D_80163300;
*temp_v1_4 = -func_802B5224(sp40 + 0x20, sp40 + 0x14);
temp_lo = (*(D_801631DC + (((D_80162FCE + 2) % D_80164430) * 2)) * 0x168) / 0xFFFF;
temp_lo_2 = (*temp_v1_4 * 0x168) / 0xFFFF;
phi_a0_2 = temp_lo;
phi_a1 = temp_lo_2;
if (temp_lo < -0xB4) {
phi_a0_2 = temp_lo + 0x168;
}
phi_a0_3 = phi_a0_2;
if (phi_a0_2 >= 0xB5) {
phi_a0_3 = phi_a0_2 - 0x168;
}
if (temp_lo_2 < -0xB4) {
phi_a1 = temp_lo_2 + 0x168;
}
phi_a1_2 = phi_a1;
if (phi_a1 >= 0xB5) {
phi_a1_2 = phi_a1 - 0x168;
}
temp_v0_12 = phi_a0_3 - phi_a1_2;
phi_v1 = temp_v0_12;
if (temp_v0_12 < -0xB4) {
phi_v1 = temp_v0_12 + 0x168;
}
phi_v1_2 = phi_v1;
if (phi_v1 >= 0xB5) {
phi_v1_2 = phi_v1 - 0x168;
}
temp_v0_13 = *sp2C;
if (temp_v0_13 != -1) {
if (temp_v0_13 != 1) {
} else if (phi_v1_2 < -5) {
*sp2C = 0;
sp40->unkBC = sp40->unkBC & ~0x10;
}
} else if (phi_v1_2 >= 6) {
*sp2C = 0;
sp40->unkBC = sp40->unkBC & ~0x10;
}
}
if ((D_80163378 & 1) != sp30) {
func_8003680C(sp40, *(&D_80163050 + sp34));
func_80008424(arg0, *(&D_80163210 + sp38), sp40);
return;
}
sp1C = sp40 + 0x14;
temp_v1_5 = sp38 + &D_801630B8;
*temp_v1_5 = func_8000B7E4(arg0, D_80162FCE);
sp28 = temp_v1_5;
func_8000D438(arg0, D_80162FCE);
temp_v0_14 = gCurrentCourseId;
if (temp_v0_14 != 0x14) {
temp_a1_3 = *(&D_80164450 + sp38);
if (temp_a1_3 < 0xB) {
temp_a0_2 = D_801630E0;
temp_v1_6 = (arg0 * 0x10) + &D_801634F8;
if ((temp_a1_3 > 0) && (temp_v0_14 == 0xA)) {
sp30 = temp_v1_6;
func_8000BBD8((((temp_a0_2 + 0x14) & 0xFFFF) % D_80164430) & 0xFFFF, 0, 0);
temp_v1_6->unk4 = 0.0f;
} else {
temp_t0_5 = sp38 + &D_80163068;
sp20 = temp_t0_5;
sp30 = temp_v1_6;
func_8000BBD8((((temp_a0_2 + 8) & 0xFFFF) % D_80164430) & 0xFFFF, *temp_t0_5, D_8016344A);
temp_v1_6->unk0 = *temp_t0_5;
}
}
if ((D_80162FD0 == 1) && (*(&D_80162FF8 + sp34) == 0)) {
func_8000BBD8((((D_801630E0 + 7) & 0xFFFF) % D_80164430) & 0xFFFF, 0xBF333333, D_8016344A);
}
if (D_80163448 == 0) {
sp3C = sp34 + &D_80162FF8;
func_8000B140(arg0);
if (*sp3C > 0) {
func_8000BBD8((((D_801630E0 + 5) & 0xFFFF) % D_80164430) & 0xFFFF, *(&D_80163090 + sp38), D_8016344A);
}
}
}
temp_t0_6 = sp38 + &D_80163068;
if (gCurrentCourseId == 0x14) {
temp_v0_15 = *(&D_80163410 + sp34);
if (temp_v0_15 != 3) {
if (temp_v0_15 != 4) {
} else {
temp_v0_16 = (((*sp24 + 0xA) % *(&D_801645C8 + sp34)) * 8) + *(&D_80164550 + sp38);
D_80162FA0.unk0 = temp_v0_16->unk0;
D_80162FA0.unk8 = temp_v0_16->unk4;
}
} else {
D_80162FA0.unk0 = *(&D_80163418 + sp38);
D_80162FA0.unk8 = *(&D_80163438 + sp38);
}
}
temp_v0_17 = sp38 + &D_80163178;
temp_v1_7 = sp38 + &D_801631A0;
D_80162FA0.unk0 = (D_80162FA0.unk0 + *temp_v0_17) * 0.5f;
D_80162FA0.unk8 = (D_80162FA0.unk8 + *temp_v1_7) * 0.5f;
*temp_v0_17 = D_80162FA0.unk0;
sp20 = temp_t0_6;
*temp_v1_7 = D_80162FA0.unk8;
temp_f2_2 = 1.5f * 182.0f;
temp_v1_8 = -func_802B5224(sp1C, &D_80162FA0) - sp40->unk2E;
temp_f10 = temp_f2_2;
temp_f6 = -1.5f * 182.0f;
phi_a2 = temp_v1_8;
if (temp_f10 < temp_v1_8) {
phi_a2 = temp_f10;
}
phi_a2_2 = phi_a2;
if (phi_a2 < temp_f6) {
phi_a2_2 = temp_f6;
}
temp_v0_18 = *(D_801631D8 + sp34);
temp_v1_9 = *(&D_800DCA20 + (gCurrentCourseId * 2));
phi_v1_4 = temp_v1_9;
phi_v1_4 = temp_v1_9;
phi_v1_4 = temp_v1_9;
if (temp_v0_18 != 2) {
if (temp_v0_18 != 3) {
} else {
temp_f0_2 = *temp_t0_6;
if (temp_f0_2 > 0.5f) {
phi_v1_4 = 0x35;
}
if (temp_f0_2 < -0.5f) {
phi_v1_4 = 0x14;
}
}
} else {
temp_f0_3 = *temp_t0_6;
if (temp_f0_3 > 0.5f) {
phi_v1_4 = 0x14;
}
if (temp_f0_3 < -0.5f) {
phi_v1_4 = 0x35;
}
}
if ((*(&D_801632E8 + sp34) == 2) && ((temp_f0_4 = *temp_t0_6, (D_800ECFB8 < temp_f0_4)) || (temp_f0_4 < D_800ECFBC))) {
*sp2C = 0;
sp40->unkBC = sp40->unkBC & ~0x10;
}
temp_v0_19 = sp40->unkBC;
if ((temp_v0_19 & 2) != 0) {
temp_v0_20 = *sp2C;
phi_a1_3 = -0x35;
if (temp_v0_20 != -1) {
phi_a1_3 = 0x35;
if (temp_v0_20 != 1) {
temp_v0_21 = sp34 + &D_80163050;
phi_v0_2 = temp_v0_21;
phi_a1_3 = (*temp_v0_21 + ((phi_a2_2 * phi_v1_4) / temp_f2_2)) / 2.0f;
} else {
phi_v0_2 = sp34 + &D_80163050;
}
} else {
phi_v0_2 = sp34 + &D_80163050;
}
} else if ((temp_v0_19 & 0x1000000C) != 0) {
phi_v0_2 = sp34 + &D_80163050;
phi_a1_3 = 0;
} else {
temp_v0_22 = sp34 + &D_80163050;
phi_v0_2 = temp_v0_22;
phi_a1_3 = (*temp_v0_22 + ((phi_a2_2 * phi_v1_4) / temp_f2_2)) / 2.0f;
}
sp3C = phi_v0_2;
sp94 = phi_a1_3;
sp20 = temp_t0_6;
func_8003680C((bitwise void *) 182.0f, sp40, phi_a1_3, phi_a2_2, sp40);
*phi_v0_2 = phi_a1_3;
if ((*sp28 == 1) || (temp_v0_23 = *sp2C, (temp_v0_23 == 1)) || (temp_v0_23 == -1) || ((sp40->unkBC & 0x1000000C) != 0)) {
sp20 = temp_t0_6;
temp_v1_11 = sp38 + &D_80163028;
*temp_v1_11 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D009418);
phi_v1_3 = temp_v1_11;
} else {
sp20 = temp_t0_6;
temp_v1_10 = sp38 + &D_80163028;
*temp_v1_10 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D009568);
phi_v1_3 = temp_v1_10;
}
temp_f0_5 = *(sp38 + &D_80163068);
if ((D_800ECFC0 < temp_f0_5) || (temp_f0_5 < D_800ECFC4)) {
sp34 = phi_v1_3;
*phi_v1_3 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D009808);
}
if (D_80162FD0 == 1) {
sp34 = phi_v1_3;
*phi_v1_3 = *segmented_to_virtual_dupe((gCurrentCourseId * 0x10) + (gCCSelection * 4) + &D_0D0096B8);
}
temp_v0_24 = *sp2C;
if ((temp_v0_24 == 2) || (temp_v0_24 == -2) || (temp_v0_24 == 3)) {
*phi_v1_3 = D_800ECFC8;
}
D_8016320C = *phi_v1_3;
sp40->unkBC = sp40->unkBC & 0xFFDFFFFF;
*(&D_80163210 + sp38) = D_8016320C;
func_800131DC(arg0);
func_80008424(arg0, D_8016320C, sp40);
// Duplicate return node #176. Try simplifying control flow for better match
return;
}
// Duplicate return node #176. Try simplifying control flow for better match
return;
}
// Duplicate return node #176. Try simplifying control flow for better match
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80009B60.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80007BF8(s32, s32, ?, ?, s32); // extern
extern f32 D_800ECFCC;
extern f32 D_800ECFD0;
extern f32 D_800ECFD4;
extern ? D_80162FF8;
extern ? D_80163010;
extern ? D_80163068;
extern ? D_80163090;
extern ? D_801630E8;
extern u16 D_80164430;
extern ? D_80164438;
extern ? gPlayers;
void func_8000B140(s32 arg0) {
s32 spFC;
s32 spF0;
s16 spE6;
s16 spE4;
f32 spDC;
? spC0;
s16 spB0;
s16 sp9C;
f32 sp74;
f32 sp60;
s32 sp5C;
s32 sp58;
f32 *sp54;
s16 *sp4C;
f32 *temp_t8;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f0_5;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f16;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
s16 *temp_a1_2;
s16 *temp_a2;
s16 *temp_t8_2;
s16 *temp_v0_7;
s16 temp_v0;
s16 temp_v0_4;
s16 temp_v1_2;
s32 temp_a1;
s32 temp_a1_3;
s32 temp_t0;
s32 temp_t0_2;
s32 temp_t5;
s32 temp_t7;
s32 temp_t9;
s32 temp_v0_6;
u16 temp_v0_2;
u32 temp_v0_3;
void *temp_v0_5;
void *temp_v1;
s16 *phi_a1;
s16 *phi_v0;
s32 phi_t0;
s16 phi_t1;
s32 phi_t2;
s32 phi_t2_2;
? *phi_t3;
s16 *phi_a1_2;
f32 phi_f18;
f32 phi_f20;
s32 phi_t0_2;
s32 phi_v0_2;
f32 phi_f18_2;
f32 phi_f20_2;
f32 phi_f20_3;
f32 phi_f18_3;
f32 phi_f18_4;
f32 phi_f20_4;
s32 phi_t0_3;
f32 phi_f18_5;
f32 phi_f20_5;
f32 phi_f20_6;
f32 phi_f18_6;
temp_v1 = (arg0 * 0xDD8) + &gPlayers;
temp_a1 = temp_v1->unkBC;
if (((temp_a1 & 0x10) == 0) && (temp_t5 = arg0 * 2, temp_v0 = *(&D_801630E8 + temp_t5), sp5C = temp_t5, (temp_v0 != 1)) && (temp_v0 != -1) && (temp_t7 = arg0 * 4, temp_t8 = &D_80163068 + temp_t7, sp54 = temp_t8, sp58 = temp_t7, temp_f0 = *temp_t8, phi_t3 = &D_80163068, !(temp_f0 < -1.0f)) && !(temp_f0 > 1.0f) && (temp_v0_2 = temp_v1->unk254, (temp_v0_2 != 5)) && (temp_v0_2 != 7) && (temp_v0_2 != 4) && ((temp_a1 & 0x200) == 0)) {
phi_a1 = &sp9C;
phi_v0 = &spB0;
phi_t1 = *(&D_80164438 + temp_t5);
phi_t2 = 0;
do {
temp_v0_3 = phi_v0 + 2;
temp_a1_2 = phi_a1 + 2;
temp_a1_2->unk-2 = -1;
temp_v0_3->unk-2 = 0x3E8;
phi_a1 = temp_a1_2;
phi_v0 = temp_v0_3;
} while (temp_v0_3 < &spC0);
temp_t8_2 = sp5C + &D_80163010;
sp4C = temp_t8_2;
temp_v0_4 = *temp_t8_2;
temp_t9 = temp_v0_4 - 1;
if (temp_v0_4 > 0) {
*temp_t8_2 = temp_t9;
if (temp_t9 <= 0) {
*(&D_80162FF8 + sp5C) = 0;
}
}
phi_t0 = 0;
phi_t0_3 = 0;
loop_15:
phi_t2_2 = phi_t2;
if (phi_t0 != arg0) {
temp_v0_5 = (phi_t0 * 0xDD8) + &gPlayers;
if ((temp_v0_5->unk0 & 0x8000) != 0) {
temp_f2 = ((temp_v1->unk94 / 18.0f) * 216.0f) - 5.0f;
temp_v1_2 = *(&D_80164438 + (phi_t0 * 2));
temp_f0_2 = (temp_v0_5->unk94 / 18.0f) * 216.0f;
if (temp_f0_2 < temp_f2) {
spE4 = temp_v1_2;
spFC = phi_t0;
spE6 = phi_t1;
spF0 = phi_t2;
spDC = temp_f0_2;
sp60 = temp_f2;
phi_t2_2 = phi_t2;
phi_t3 = &D_80163068;
if (func_80007BF8(temp_v1_2 & 0xFFFF, phi_t1 & 0xFFFF, 0, 0x14, D_80164430) > 0) {
temp_v0_6 = phi_t2 * 2;
temp_a1_3 = temp_v1_2 - phi_t1;
(sp + temp_v0_6)->unk9C = phi_t0;
temp_a2 = temp_v0_6 + &spB0;
if (temp_a1_3 > 0) {
*temp_a2 = temp_a1_3;
} else {
*temp_a2 = (temp_v1_2 + D_80164430) - phi_t1;
}
*((phi_t2 * 4) + &sp74) = temp_f2 - temp_f0_2;
phi_t2_2 = phi_t2 + 1;
}
}
}
}
temp_t0 = phi_t0 + 1;
phi_t0 = temp_t0;
phi_t1 = phi_t1;
phi_t2 = phi_t2_2;
if ((phi_t2_2 < 2) && (temp_t0 < 8)) {
goto loop_15;
}
if (phi_t2_2 != 0) {
phi_f20_3 = -1.0f;
phi_f18_3 = 1.0f;
phi_f18 = 1.0f;
phi_f20 = -1.0f;
phi_f20_6 = -1.0f;
phi_f18_6 = 1.0f;
phi_f18_6 = 1.0f;
if (phi_t2_2 > 0) {
if ((phi_t2_2 & 1) != 0) {
temp_f2_2 = *(phi_t3 + (sp9C * 4));
phi_t0_3 = 1;
if ((temp_f2_2 > -1.0f) && (temp_f2_2 < 1.0f)) {
temp_f12 = ((sp74 + 10.0f) * (D_800ECFCC * (20.0f / (spB0 + 20.0f)))) / 20.0f;
if ((1.0f == 1.0f) && (-1.0f == -1.0f)) {
phi_f20_6 = temp_f2_2 + temp_f12;
phi_f18_6 = temp_f2_2 - temp_f12;
} else {
temp_f14 = temp_f2_2 - temp_f12;
temp_f16 = temp_f2_2 + temp_f12;
if ((temp_f14 < 1.0f) && ((temp_f2_2 + temp_f12) > 1.0f)) {
phi_f18_6 = temp_f14;
}
if ((temp_f16 > -1.0f) && (temp_f14 < -1.0f)) {
phi_f20_6 = temp_f16;
}
}
}
phi_f20_3 = phi_f20_6;
phi_f18_3 = phi_f18_6;
phi_f18 = phi_f18_6;
phi_f20 = phi_f20_6;
if (phi_t2_2 != 1) {
goto block_40;
}
} else {
block_40:
phi_a1_2 = &(&sp9C)[phi_t0_3];
phi_t0_2 = phi_t0_3;
phi_v0_2 = phi_t0_3 * 2;
do {
temp_f2_3 = *(phi_t3 + (phi_a1_2->unk0 * 4));
phi_f18_2 = phi_f18;
phi_f20_2 = phi_f20;
phi_f18_2 = phi_f18;
if ((temp_f2_3 > -1.0f) && (temp_f2_3 < 1.0f)) {
temp_f0_3 = (((&sp74)[phi_t0_2].unk0 + 10.0f) * (D_800ECFD0 * (20.0f / (*(&spB0 + phi_v0_2) + 20.0f)))) / 20.0f;
if ((phi_f18 == 1.0f) && (phi_f20 == -1.0f)) {
phi_f18_2 = temp_f2_3 - temp_f0_3;
phi_f20_2 = temp_f2_3 + temp_f0_3;
} else {
temp_f12_2 = temp_f2_3 - temp_f0_3;
temp_f14_2 = temp_f2_3 + temp_f0_3;
if ((temp_f12_2 < phi_f18) && (phi_f18 < (temp_f2_3 + temp_f0_3))) {
phi_f18_2 = temp_f12_2;
}
if ((phi_f20 < temp_f14_2) && (temp_f12_2 < phi_f20)) {
phi_f20_2 = temp_f14_2;
}
}
}
temp_f0_4 = *(phi_t3 + (phi_a1_2->unk2 * 4));
phi_a1_2 += 4;
phi_f18_5 = phi_f18_2;
phi_f20_5 = phi_f20_2;
phi_f18_5 = phi_f18_2;
if ((temp_f0_4 > -1.0f) && (temp_f0_4 < 1.0f)) {
temp_f2_4 = (((&sp74)[phi_t0_2].unk4 + 10.0f) * (D_800ECFD4 * (20.0f / ((&spB0 + phi_v0_2)->unk2 + 20.0f)))) / 20.0f;
if ((phi_f18_2 == 1.0f) && (phi_f20_2 == -1.0f)) {
phi_f18_5 = temp_f0_4 - temp_f2_4;
phi_f20_5 = temp_f0_4 + temp_f2_4;
} else {
temp_f12_3 = temp_f0_4 - temp_f2_4;
temp_f14_3 = temp_f0_4 + temp_f2_4;
if ((temp_f12_3 < phi_f18_2) && (phi_f18_2 < (temp_f0_4 + temp_f2_4))) {
phi_f18_5 = temp_f12_3;
}
if ((phi_f20_2 < temp_f14_3) && (temp_f12_3 < phi_f20_2)) {
phi_f20_5 = temp_f14_3;
}
}
}
temp_t0_2 = phi_t0_2 + 2;
phi_f18 = phi_f18_5;
phi_f20 = phi_f20_5;
phi_t0_2 = temp_t0_2;
phi_v0_2 += 4;
phi_f20_3 = phi_f20_5;
phi_f18_3 = phi_f18_5;
} while (temp_t0_2 != phi_t2_2);
}
}
phi_f18_4 = phi_f18_3;
phi_f20_4 = phi_f20_3;
if (!(phi_f20_3 < phi_f18_3) && (temp_f0_5 = *sp54, !(temp_f0_5 < phi_f18_3)) && !(phi_f20_3 < temp_f0_5)) {
temp_v0_7 = sp5C + &D_80162FF8;
if (phi_f20_3 > 1.0f) {
phi_f20_4 = 1.0f;
}
if (phi_f18_3 < -1.0f) {
phi_f18_4 = -1.0f;
}
if ((phi_f18_4 + 1.0f) < (1.0f - phi_f20_4)) {
*sp4C = 0x3C;
*temp_v0_7 = 1;
*(&D_80163090 + sp58) = phi_f20_4;
return;
}
*sp4C = 0x3C;
*temp_v0_7 = 2;
*(&D_80163090 + sp58) = phi_f18_4;
// Duplicate return node #74. Try simplifying control flow for better match
return;
}
// Duplicate return node #74. Try simplifying control flow for better match
return;
}
// Duplicate return node #74. Try simplifying control flow for better match
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B140.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_801645E0;
? func_8000B7E4(s32 arg0, s32 arg1) {
if (*(D_801645E0 + ((arg1 & 0xFFFF) * 2)) > 0) {
return 1;
}
return 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B7E4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFD8;
extern f32 D_800ECFDC;
extern ? D_80163068;
? func_8000B820(s32 arg0) {
f32 temp_f0;
temp_f0 = *(&D_80163068 + (arg0 * 4));
if ((D_800ECFD8 <= temp_f0) || (temp_f0 <= D_800ECFDC)) {
return 1;
}
return 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B820.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFE0;
extern ? D_80164560;
extern ? D_80164570;
f32 func_8000B874(f32 arg0, f32 arg1, s32 arg2, s32 arg3) {
f32 spC;
f32 sp8;
f32 sp4;
f32 temp_f16;
f32 temp_f2;
f32 temp_f8;
s32 temp_a0;
s32 temp_v1;
void *temp_a1;
void *temp_v0;
temp_v1 = arg3 * 4;
temp_a0 = (arg2 & 0xFFFF) * 8;
temp_v0 = *(&D_80164560 + temp_v1) + temp_a0;
temp_a1 = *(&D_80164570 + temp_v1) + temp_a0;
temp_f2 = temp_v0->unk0;
temp_f16 = temp_v0->unk4;
spC = temp_a1->unk0 - temp_f2;
sp8 = temp_a1->unk4 - temp_f16;
temp_f8 = (spC * spC) + (sp8 * sp8);
sp4 = temp_f8;
if (temp_f8 < D_800ECFE0) {
return 0.0f;
}
return ((2.0f * ((spC * (arg0 - temp_f2)) + (sp8 * (arg1 - temp_f16)))) / sp4) - 1.0f;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B874.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 func_8000B874(f32, f32, s32, s32, ?); // extern
extern ? D_800DCA4C;
extern ? D_80163068;
extern ? gPlayers;
void func_8000B95C(s32 arg0, s32 arg1, ? arg2) {
f32 *sp18;
f32 *temp_v1;
s32 temp_t6;
void *temp_v0;
temp_v1 = (arg0 * 4) + &D_80163068;
*temp_v1 = 0.0f;
temp_t6 = arg1 & 0xFFFF;
if (*(&D_800DCA4C + (gCurrentCourseId * 4)) >= 0) {
temp_v0 = (arg0 * 0xDD8) + &gPlayers;
if ((temp_v0->unk0 & 0x8000) != 0) {
sp18 = temp_v1;
*temp_v1 = func_8000B874(temp_v0->unk14, temp_v0->unk1C, temp_t6, temp_t6 & 0xFFFF, arg2);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B95C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFE4;
extern ? D_80162FA0;
extern f32 D_80162FA8;
extern u16 D_80164430;
void func_8000BA14(s32 arg0, f32 arg1, f32 arg2, s16 arg3) {
f32 sp54;
f32 sp50;
f32 sp4C;
f32 sp48;
f32 sp20;
f32 sp1C;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f12;
f32 temp_f14;
f32 temp_f16;
f32 temp_f18;
f32 temp_f2;
f32 temp_f2_2;
s16 *temp_v1;
s32 temp_t6;
void *temp_a1;
void *temp_v0;
temp_t6 = arg0 & 0xFFFF;
temp_v1 = (&D_80164550)[arg3];
temp_v0 = temp_v1 + (temp_t6 * 8);
temp_a1 = temp_v1 + (((temp_t6 + 1) % D_80164430) * 8);
temp_f18 = temp_v0->unk0;
sp54 = temp_f18;
temp_f2 = temp_a1->unk0;
sp48 = temp_a1->unk4;
temp_f0 = temp_v0->unk4;
temp_f16 = temp_f2 - temp_f18;
sp50 = temp_f0;
sp4C = temp_f2;
temp_f14 = sp48 - temp_f0;
sp1C = temp_f16;
sp20 = temp_f14;
temp_f0_2 = sqrtf((temp_f16 * temp_f16) + (temp_f14 * temp_f14));
if (temp_f0_2 < D_800ECFE4) {
D_80162FA0.unk0 = temp_f2;
D_80162FA0.unk8 = sp48;
return;
}
temp_f2_2 = 0.5f - (arg1 * 0.5f);
temp_f12 = 1.0f - temp_f2_2;
D_80162FA0.unk0 = (temp_f2_2 * (((arg2 * temp_f14) / temp_f0_2) + temp_f18)) + (temp_f12 * (((arg2 * -temp_f14) / temp_f0_2) + temp_f18));
D_80162FA8 = (temp_f2_2 * (((arg2 * -temp_f16) / temp_f0_2) + sp50)) + (temp_f12 * (((arg2 * temp_f16) / temp_f0_2) + sp50));
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000BA14.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_80162FA0;
extern f32 D_80162FA8;
extern ? D_80164560;
extern ? D_80164570;
extern ? D_801645C8;
void func_8000BBD8(s32 arg0, f32 arg1, s16 arg2) {
f32 sp14;
f32 sp10;
f32 sp8;
f32 sp4;
f32 sp0;
f32 temp_f0;
f32 temp_f12;
f32 temp_f4;
f32 temp_f4_2;
f32 temp_f8;
f32 temp_f8_2;
s32 temp_a1;
s32 temp_a3;
s32 temp_a3_2;
s32 temp_t1;
s32 temp_t6;
s32 temp_v1;
void *temp_t0;
void *temp_t0_2;
void *temp_v0;
void *temp_v0_2;
temp_t6 = arg0 & 0xFFFF;
temp_a3 = temp_t6 * 8;
temp_v1 = arg2 * 4;
temp_a1 = *(&D_80164560 + temp_v1);
temp_t1 = *(&D_80164570 + temp_v1);
temp_v0 = temp_a1 + temp_a3;
temp_t0 = temp_t1 + temp_a3;
sp8 = temp_t0->unk4;
temp_a3_2 = ((((temp_t6 + 1) & 0xFFFF) % *(&D_801645C8 + (arg2 * 2))) & 0xFFFF) * 8;
temp_v0_2 = temp_a1 + temp_a3_2;
temp_t0_2 = temp_t1 + temp_a3_2;
temp_f8 = temp_v0_2->unk0;
sp14 = temp_f8;
temp_f4 = temp_v0_2->unk4;
sp10 = temp_f4;
temp_f8_2 = temp_t0_2->unk0;
sp4 = temp_f8_2;
temp_f4_2 = temp_t0_2->unk4;
sp0 = temp_f4_2;
temp_f0 = 0.5f - (arg1 * 0.5f);
temp_f12 = 1.0f - temp_f0;
D_80162FA0 = ((temp_v0->unk0 + temp_f8) * temp_f0 * 0.5f) + (temp_f12 * (temp_t0->unk0 + temp_f8_2) * 0.5f);
D_80162FA8 = ((temp_v0->unk4 + temp_f4) * temp_f0 * 0.5f) + (temp_f12 * (sp8 + temp_f4_2) * 0.5f);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000BBD8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801645C8;
s16 func_8000BD94(f32 arg0, f32 arg1, f32 arg2, s32 arg3) {
f32 temp_f0;
f32 temp_f16;
f32 temp_f18;
f32 temp_f22;
f32 temp_f22_2;
f32 temp_f22_3;
f32 temp_f22_4;
f32 temp_f22_5;
f32 temp_f24;
f32 temp_f24_2;
f32 temp_f24_3;
f32 temp_f24_4;
f32 temp_f24_5;
f32 temp_f26;
f32 temp_f26_2;
f32 temp_f26_3;
f32 temp_f26_4;
f32 temp_f26_5;
f32 temp_f2;
s16 *temp_a0;
s16 *temp_a0_2;
s16 temp_a2;
s16 temp_a2_2;
s32 temp_t1;
u16 temp_v1;
void *temp_a0_3;
void *temp_a0_4;
s16 *phi_a0;
f32 phi_f18;
s16 phi_a2;
s16 *phi_a0_2;
f32 phi_f18_2;
f32 phi_f18_3;
f32 phi_f18_4;
f32 phi_f18_5;
s16 phi_a2_2;
s16 phi_a1;
f32 phi_f18_6;
s16 phi_a1_2;
s16 phi_a1_3;
temp_a0 = (&D_80164550)[arg3];
temp_v1 = *(&D_801645C8 + (arg3 * 2));
temp_f0 = temp_a0->unk0 - arg0;
temp_t1 = (temp_v1 - 1) & 3;
temp_f2 = temp_a0->unk2 - arg1;
temp_f16 = temp_a0->unk4 - arg2;
temp_f18 = (temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f16 * temp_f16);
phi_a0 = temp_a0;
phi_f18 = temp_f18;
phi_a2 = 1;
phi_a0_2 = temp_a0;
phi_f18_2 = temp_f18;
phi_a2_2 = 1;
phi_a1 = 0;
phi_a1_2 = 0;
phi_a1_3 = 0;
if (temp_v1 >= 2) {
if (temp_t1 != 0) {
do {
temp_f22 = phi_a0->unk0 - arg0;
temp_f24 = phi_a0->unk2 - arg1;
temp_f26 = phi_a0->unk4 - arg2;
phi_f18_6 = phi_f18;
if (((temp_f22 * temp_f22) + (temp_f24 * temp_f24) + (temp_f26 * temp_f26)) < phi_f18) {
phi_f18_6 = (temp_f22 * temp_f22) + (temp_f24 * temp_f24) + (temp_f26 * temp_f26);
phi_a1_2 = phi_a2;
}
temp_a2 = phi_a2 + 1;
temp_a0_2 = phi_a0 + 8;
phi_a0 = temp_a0_2;
phi_f18 = phi_f18_6;
phi_a2 = temp_a2;
phi_a0_2 = temp_a0_2;
phi_f18_2 = phi_f18_6;
phi_a2_2 = temp_a2;
phi_a1 = phi_a1_2;
phi_a1_3 = phi_a1_2;
} while ((temp_t1 + 1) != temp_a2);
if (temp_a2 != temp_v1) {
goto loop_6;
}
} else {
do {
loop_6:
temp_f22_2 = phi_a0_2->unk0 - arg0;
temp_f24_2 = phi_a0_2->unk2 - arg1;
temp_f26_2 = phi_a0_2->unk4 - arg2;
phi_f18_3 = phi_f18_2;
if (((temp_f22_2 * temp_f22_2) + (temp_f24_2 * temp_f24_2) + (temp_f26_2 * temp_f26_2)) < phi_f18_2) {
phi_f18_3 = (temp_f22_2 * temp_f22_2) + (temp_f24_2 * temp_f24_2) + (temp_f26_2 * temp_f26_2);
phi_a1_3 = phi_a2_2;
}
temp_a0_3 = phi_a0_2 + 8;
temp_f22_3 = phi_a0_2->unk8 - arg0;
temp_f24_3 = phi_a0_2->unkA - arg1;
temp_f26_3 = phi_a0_2->unkC - arg2;
phi_f18_4 = phi_f18_3;
if (((temp_f22_3 * temp_f22_3) + (temp_f24_3 * temp_f24_3) + (temp_f26_3 * temp_f26_3)) < phi_f18_3) {
phi_f18_4 = (temp_f22_3 * temp_f22_3) + (temp_f24_3 * temp_f24_3) + (temp_f26_3 * temp_f26_3);
phi_a1_3 = phi_a2_2 + 1;
}
temp_a0_4 = temp_a0_3 + 8;
temp_f22_4 = temp_a0_3->unk8 - arg0;
temp_f24_4 = temp_a0_3->unkA - arg1;
temp_f26_4 = temp_a0_3->unkC - arg2;
phi_f18_5 = phi_f18_4;
if (((temp_f22_4 * temp_f22_4) + (temp_f24_4 * temp_f24_4) + (temp_f26_4 * temp_f26_4)) < phi_f18_4) {
phi_f18_5 = (temp_f22_4 * temp_f22_4) + (temp_f24_4 * temp_f24_4) + (temp_f26_4 * temp_f26_4);
phi_a1_3 = phi_a2_2 + 2;
}
temp_f22_5 = temp_a0_4->unk8 - arg0;
temp_f24_5 = temp_a0_4->unkA - arg1;
temp_f26_5 = temp_a0_4->unkC - arg2;
phi_f18_2 = phi_f18_5;
if (((temp_f22_5 * temp_f22_5) + (temp_f24_5 * temp_f24_5) + (temp_f26_5 * temp_f26_5)) < phi_f18_5) {
phi_f18_2 = (temp_f22_5 * temp_f22_5) + (temp_f24_5 * temp_f24_5) + (temp_f26_5 * temp_f26_5);
phi_a1_3 = phi_a2_2 + 3;
}
temp_a2_2 = phi_a2_2 + 4;
phi_a0_2 = temp_a0_4 + 8 + 8;
phi_a2_2 = temp_a2_2;
phi_a1 = phi_a1_3;
} while (temp_a2_2 != temp_v1);
}
}
return phi_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000BD94.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFE8;
extern f32 D_800ECFEC;
extern ? D_80163368;
extern u16 D_801645C8;
s16 func_8000C0BC(f32 arg0, f32 arg1, f32 arg2, s32 arg3, s32 *arg4) {
s32 sp28;
f32 temp_f0;
f32 temp_f12;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f18;
f32 temp_f18_10;
f32 temp_f18_11;
f32 temp_f18_2;
f32 temp_f18_3;
f32 temp_f18_4;
f32 temp_f18_5;
f32 temp_f18_6;
f32 temp_f18_7;
f32 temp_f18_8;
f32 temp_f18_9;
f32 temp_f24;
f32 temp_f24_10;
f32 temp_f24_11;
f32 temp_f24_2;
f32 temp_f24_3;
f32 temp_f24_4;
f32 temp_f24_5;
f32 temp_f24_6;
f32 temp_f24_7;
f32 temp_f24_8;
f32 temp_f24_9;
f32 temp_f26;
f32 temp_f26_10;
f32 temp_f26_11;
f32 temp_f26_2;
f32 temp_f26_3;
f32 temp_f26_4;
f32 temp_f26_5;
f32 temp_f26_6;
f32 temp_f26_7;
f32 temp_f26_8;
f32 temp_f26_9;
f32 temp_f2;
s16 *temp_t2;
s16 *temp_t2_2;
s16 *temp_v0_3;
s16 *temp_v0_4;
s16 temp_v1;
s16 temp_v1_2;
s16 temp_v1_3;
s16 temp_v1_4;
s32 temp_t0;
s32 temp_t1;
s32 temp_t6;
s32 temp_t8;
u16 temp_a2;
u16 temp_a2_2;
u16 temp_a2_3;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_5;
void *temp_v0_6;
s16 *phi_v0;
f32 phi_f16;
f32 phi_f16_2;
s16 phi_v1;
s32 phi_t1;
s32 phi_t1_2;
f32 phi_f16_3;
s16 *phi_v0_2;
f32 phi_f16_4;
f32 phi_f16_5;
s16 phi_v1_2;
s32 phi_t4;
s32 phi_a1;
s16 *phi_v0_3;
f32 phi_f16_6;
s16 phi_v1_3;
s16 *phi_v0_4;
f32 phi_f16_7;
f32 phi_f16_8;
f32 phi_f16_9;
f32 phi_f16_10;
s16 phi_v1_4;
s32 phi_a1_2;
s32 phi_t4_2;
s16 phi_a0;
f32 phi_f16_11;
s32 phi_t1_3;
s32 phi_t1_4;
f32 phi_f16_12;
f32 phi_f16_13;
s32 phi_t4_3;
s32 phi_t4_4;
s32 phi_t4_5;
s32 phi_a1_3;
s32 phi_a1_4;
f32 phi_f16_14;
s32 phi_a1_5;
s32 phi_a1_6;
s32 phi_t4_6;
s32 phi_t4_7;
s16 phi_a0_2;
s16 phi_a0_3;
f32 phi_f16_15;
s32 phi_a1_7;
s32 phi_a1_8;
s32 phi_a1_9;
s32 phi_a1_10;
s32 phi_a1_11;
s16 phi_a0_4;
s16 phi_a0_5;
s16 phi_a0_6;
s16 phi_a0_7;
s16 phi_a0_8;
s16 phi_a0_9;
temp_t0 = *arg4;
temp_a2 = *(&D_801645C8 + (temp_t0 * 2));
temp_t2 = (&D_80164550)[temp_t0];
temp_t6 = arg3 & 0xFFFF;
temp_f16 = D_800ECFE8;
phi_t1 = 0;
phi_t1_2 = 0;
phi_v1_2 = 0;
phi_a0 = 0;
phi_v0 = temp_t2;
phi_f16 = temp_f16;
phi_v1 = 0;
phi_t1_3 = 0;
phi_f16_3 = temp_f16;
phi_a1_3 = 0;
phi_f16_15 = temp_f16;
phi_a1_7 = 0;
phi_a0_4 = 0;
phi_a0_2 = 0;
phi_a0_8 = 0;
phi_t1_4 = 0;
phi_a1_8 = 0;
phi_a0_3 = 0;
phi_a0_6 = 0;
if (temp_a2 > 0) {
if ((temp_a2 & 1) != 0) {
phi_v1 = 1;
if ((temp_t6 == temp_t2->unk6) || (gCurrentCourseId == 0x14)) {
temp_f18 = temp_t2->unk0 - arg0;
temp_f24 = temp_t2->unk2 - arg1;
temp_f26 = temp_t2->unk4 - arg2;
phi_t1_3 = 1;
if (((temp_f18 * temp_f18) + (temp_f24 * temp_f24) + (temp_f26 * temp_f26)) < D_800ECFEC) {
phi_f16_15 = (temp_f18 * temp_f18) + (temp_f24 * temp_f24) + (temp_f26 * temp_f26);
phi_a1_7 = 1;
}
}
phi_t1 = phi_t1_3;
phi_v0 = temp_t2 + 8;
phi_f16 = phi_f16_15;
phi_f16_3 = phi_f16_15;
phi_a1_3 = phi_a1_7;
phi_a0_4 = 0;
phi_t1_4 = phi_t1_3;
phi_a1_8 = phi_a1_7;
phi_a0_6 = 0;
if (temp_a2 != 1) {
goto block_7;
}
} else {
block_7:
do {
phi_f16_2 = phi_f16;
if ((temp_t6 == phi_v0->unk6) || (gCurrentCourseId == 0x14)) {
temp_f18_2 = phi_v0->unk0 - arg0;
temp_f24_2 = phi_v0->unk2 - arg1;
temp_f26_2 = phi_v0->unk4 - arg2;
phi_t1_4 = 1;
if (((temp_f18_2 * temp_f18_2) + (temp_f24_2 * temp_f24_2) + (temp_f26_2 * temp_f26_2)) < phi_f16) {
phi_f16_2 = (temp_f18_2 * temp_f18_2) + (temp_f24_2 * temp_f24_2) + (temp_f26_2 * temp_f26_2);
phi_a1_8 = 1;
phi_a0_6 = phi_v1;
}
}
temp_v0 = phi_v0 + 8;
phi_f16_11 = phi_f16_2;
if ((temp_t6 == phi_v0->unkE) || (gCurrentCourseId == 0x14)) {
temp_f18_3 = temp_v0->unk0 - arg0;
temp_f24_3 = temp_v0->unk2 - arg1;
temp_f26_3 = temp_v0->unk4 - arg2;
phi_t1_4 = 1;
if (((temp_f18_3 * temp_f18_3) + (temp_f24_3 * temp_f24_3) + (temp_f26_3 * temp_f26_3)) < phi_f16_2) {
phi_f16_11 = (temp_f18_3 * temp_f18_3) + (temp_f24_3 * temp_f24_3) + (temp_f26_3 * temp_f26_3);
phi_a1_8 = 1;
phi_a0_6 = phi_v1 + 1;
}
}
temp_v1 = phi_v1 + 2;
phi_v0 = temp_v0 + 8;
phi_f16 = phi_f16_11;
phi_v1 = temp_v1;
phi_t1 = phi_t1_4;
phi_f16_3 = phi_f16_11;
phi_a1_3 = phi_a1_8;
phi_a0_4 = phi_a0_6;
} while (temp_v1 != temp_a2);
}
}
phi_a1 = phi_a1_3;
phi_t4_3 = sp28;
phi_a0 = phi_a0_4;
phi_a1_9 = phi_a1_3;
phi_a0_7 = phi_a0_4;
if (phi_t1 == 0) {
do {
phi_f16_4 = phi_f16_3;
phi_t4 = phi_t4_3;
phi_f16_12 = phi_f16_3;
phi_t4_4 = phi_t4_3;
phi_a1_4 = phi_a1_9;
phi_a1_10 = phi_a1_9;
phi_a0_5 = phi_a0_7;
phi_t4_5 = phi_t4_3;
phi_a0_8 = phi_a0_7;
phi_a1_11 = phi_a1_9;
phi_a0_9 = phi_a0_7;
if ((phi_t1_2 != temp_t0) && (*(&D_80163368 + (phi_t1_2 * 4)) >= 2)) {
temp_a2_2 = *(&D_801645C8 + (phi_t1_2 * 2));
temp_t2_2 = (&D_80164550)[phi_t1_2];
phi_v0_2 = temp_t2_2;
if (temp_a2_2 > 0) {
if ((temp_a2_2 & 1) != 0) {
phi_v1_2 = 1;
if (temp_t6 == temp_t2_2->unk6) {
temp_f18_4 = temp_t2_2->unk0 - arg0;
temp_f24_4 = temp_t2_2->unk2 - arg1;
temp_f26_4 = temp_t2_2->unk4 - arg2;
if (((temp_f18_4 * temp_f18_4) + (temp_f24_4 * temp_f24_4) + (temp_f26_4 * temp_f26_4)) < phi_f16_3) {
phi_f16_12 = (temp_f18_4 * temp_f18_4) + (temp_f24_4 * temp_f24_4) + (temp_f26_4 * temp_f26_4);
phi_t4_4 = phi_t1_2;
phi_a1_10 = 2;
}
}
phi_v0_2 = temp_t2_2 + 8;
phi_f16_4 = phi_f16_12;
phi_t4 = phi_t4_4;
phi_f16_3 = phi_f16_12;
phi_a1_4 = phi_a1_10;
phi_a0_5 = phi_a0_8;
phi_t4_5 = phi_t4_4;
phi_a1_11 = phi_a1_10;
phi_a0_9 = phi_a0_8;
if (temp_a2_2 != 1) {
goto loop_27;
}
} else {
do {
loop_27:
phi_f16_5 = phi_f16_4;
if (temp_t6 == phi_v0_2->unk6) {
temp_f18_5 = phi_v0_2->unk0 - arg0;
temp_f24_5 = phi_v0_2->unk2 - arg1;
temp_f26_5 = phi_v0_2->unk4 - arg2;
if (((temp_f18_5 * temp_f18_5) + (temp_f24_5 * temp_f24_5) + (temp_f26_5 * temp_f26_5)) < phi_f16_4) {
phi_f16_5 = (temp_f18_5 * temp_f18_5) + (temp_f24_5 * temp_f24_5) + (temp_f26_5 * temp_f26_5);
phi_t4_5 = phi_t1_2;
phi_a1_11 = 2;
phi_a0_9 = phi_v1_2;
}
}
temp_v0_2 = phi_v0_2 + 8;
phi_f16_13 = phi_f16_5;
if (temp_t6 == phi_v0_2->unkE) {
temp_f18_6 = temp_v0_2->unk0 - arg0;
temp_f24_6 = temp_v0_2->unk2 - arg1;
temp_f26_6 = temp_v0_2->unk4 - arg2;
if (((temp_f18_6 * temp_f18_6) + (temp_f24_6 * temp_f24_6) + (temp_f26_6 * temp_f26_6)) < phi_f16_5) {
phi_f16_13 = (temp_f18_6 * temp_f18_6) + (temp_f24_6 * temp_f24_6) + (temp_f26_6 * temp_f26_6);
phi_t4_5 = phi_t1_2;
phi_a1_11 = 2;
phi_a0_9 = phi_v1_2 + 1;
}
}
temp_v1_2 = phi_v1_2 + 2;
phi_v0_2 = temp_v0_2 + 8;
phi_f16_4 = phi_f16_13;
phi_v1_2 = temp_v1_2;
phi_t4 = phi_t4_5;
phi_f16_3 = phi_f16_13;
phi_a1_4 = phi_a1_11;
phi_a0_5 = phi_a0_9;
} while (temp_v1_2 != temp_a2_2);
}
}
}
temp_t1 = phi_t1_2 + 1;
phi_t1_2 = temp_t1;
phi_a1 = phi_a1_4;
phi_t4_3 = phi_t4;
phi_a0 = phi_a0_5;
phi_a1_9 = phi_a1_4;
phi_a0_7 = phi_a0_5;
} while (temp_t1 != 4);
sp28 = phi_t4;
}
phi_a1_2 = phi_a1;
phi_t4_2 = sp28;
phi_a1_5 = phi_a1;
phi_t4_6 = sp28;
phi_a1_6 = phi_a1;
phi_t4_7 = sp28;
if (phi_a1 == 0) {
temp_v0_3 = D_80164550;
temp_a2_3 = D_801645C8;
temp_t8 = (temp_a2_3 - 1) & 3;
temp_f0 = temp_v0_3->unk0 - arg0;
temp_f2 = temp_v0_3->unk2 - arg1;
temp_f12 = temp_v0_3->unk4 - arg2;
temp_f16_2 = (temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f12 * temp_f12);
phi_v0_3 = temp_v0_3;
phi_f16_6 = temp_f16_2;
phi_v1_3 = 1;
phi_v0_4 = temp_v0_3;
phi_f16_7 = temp_f16_2;
phi_v1_4 = 1;
if (temp_a2_3 >= 2) {
if (temp_t8 != 0) {
do {
temp_f18_7 = phi_v0_3->unk0 - arg0;
temp_f24_7 = phi_v0_3->unk2 - arg1;
temp_f26_7 = phi_v0_3->unk4 - arg2;
phi_f16_14 = phi_f16_6;
if (((temp_f18_7 * temp_f18_7) + (temp_f24_7 * temp_f24_7) + (temp_f26_7 * temp_f26_7)) < phi_f16_6) {
phi_f16_14 = (temp_f18_7 * temp_f18_7) + (temp_f24_7 * temp_f24_7) + (temp_f26_7 * temp_f26_7);
phi_a1_5 = 2;
phi_t4_6 = 0;
phi_a0_2 = phi_v1_3;
}
temp_v1_3 = phi_v1_3 + 1;
temp_v0_4 = phi_v0_3 + 8;
phi_v0_3 = temp_v0_4;
phi_f16_6 = phi_f16_14;
phi_v1_3 = temp_v1_3;
phi_v0_4 = temp_v0_4;
phi_f16_7 = phi_f16_14;
phi_v1_4 = temp_v1_3;
phi_a1_2 = phi_a1_5;
phi_t4_2 = phi_t4_6;
phi_a0 = phi_a0_2;
phi_a1_6 = phi_a1_5;
phi_t4_7 = phi_t4_6;
phi_a0_3 = phi_a0_2;
} while ((temp_t8 + 1) != temp_v1_3);
if (temp_v1_3 != temp_a2_3) {
goto loop_43;
}
} else {
do {
loop_43:
temp_f18_8 = phi_v0_4->unk0 - arg0;
temp_f24_8 = phi_v0_4->unk2 - arg1;
temp_f26_8 = phi_v0_4->unk4 - arg2;
phi_f16_8 = phi_f16_7;
if (((temp_f18_8 * temp_f18_8) + (temp_f24_8 * temp_f24_8) + (temp_f26_8 * temp_f26_8)) < phi_f16_7) {
phi_f16_8 = (temp_f18_8 * temp_f18_8) + (temp_f24_8 * temp_f24_8) + (temp_f26_8 * temp_f26_8);
phi_a1_6 = 2;
phi_t4_7 = 0;
phi_a0_3 = phi_v1_4;
}
temp_v0_5 = phi_v0_4 + 8;
temp_f18_9 = phi_v0_4->unk8 - arg0;
temp_f24_9 = phi_v0_4->unkA - arg1;
temp_f26_9 = phi_v0_4->unkC - arg2;
phi_f16_9 = phi_f16_8;
if (((temp_f18_9 * temp_f18_9) + (temp_f24_9 * temp_f24_9) + (temp_f26_9 * temp_f26_9)) < phi_f16_8) {
phi_f16_9 = (temp_f18_9 * temp_f18_9) + (temp_f24_9 * temp_f24_9) + (temp_f26_9 * temp_f26_9);
phi_a1_6 = 2;
phi_t4_7 = 0;
phi_a0_3 = phi_v1_4 + 1;
}
temp_v0_6 = temp_v0_5 + 8;
temp_f18_10 = temp_v0_5->unk8 - arg0;
temp_f24_10 = temp_v0_5->unkA - arg1;
temp_f26_10 = temp_v0_5->unkC - arg2;
phi_f16_10 = phi_f16_9;
if (((temp_f18_10 * temp_f18_10) + (temp_f24_10 * temp_f24_10) + (temp_f26_10 * temp_f26_10)) < phi_f16_9) {
phi_f16_10 = (temp_f18_10 * temp_f18_10) + (temp_f24_10 * temp_f24_10) + (temp_f26_10 * temp_f26_10);
phi_a1_6 = 2;
phi_t4_7 = 0;
phi_a0_3 = phi_v1_4 + 2;
}
temp_f18_11 = temp_v0_6->unk8 - arg0;
temp_f24_11 = temp_v0_6->unkA - arg1;
temp_f26_11 = temp_v0_6->unkC - arg2;
phi_f16_7 = phi_f16_10;
if (((temp_f18_11 * temp_f18_11) + (temp_f24_11 * temp_f24_11) + (temp_f26_11 * temp_f26_11)) < phi_f16_10) {
phi_f16_7 = (temp_f18_11 * temp_f18_11) + (temp_f24_11 * temp_f24_11) + (temp_f26_11 * temp_f26_11);
phi_a1_6 = 2;
phi_t4_7 = 0;
phi_a0_3 = phi_v1_4 + 3;
}
temp_v1_4 = phi_v1_4 + 4;
phi_v0_4 = temp_v0_6 + 8 + 8;
phi_v1_4 = temp_v1_4;
phi_a1_2 = phi_a1_6;
phi_t4_2 = phi_t4_7;
phi_a0 = phi_a0_3;
} while (temp_v1_4 != temp_a2_3);
}
}
}
if (phi_a1_2 == 2) {
*arg4 = phi_t4_2;
}
return phi_a0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000C0BC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFF0;
extern ? D_801645C8;
s16 func_8000C884(f32 arg0, f32 arg1, f32 arg2, s16 arg3, s32 arg4, u16 arg5) {
f32 temp_f14;
f32 temp_f16;
f32 temp_f18;
f32 temp_f2;
s16 temp_a2;
s16 temp_t0;
s32 temp_hi;
s32 temp_t1;
u16 temp_v0;
void *temp_a3;
s16 phi_a2;
f32 phi_f0;
s16 phi_v1;
s16 phi_v1_2;
temp_t0 = arg3 - 3;
temp_t1 = arg3 + 7;
temp_v0 = *(&D_801645C8 + (arg4 * 2));
phi_a2 = temp_t0;
phi_f0 = D_800ECFF0;
phi_v1 = -1;
phi_v1_2 = -1;
if (temp_t0 < temp_t1) {
do {
temp_hi = (phi_a2 + temp_v0) % temp_v0;
temp_a3 = (temp_hi * 8) + (&D_80164550)[arg4];
temp_a2 = phi_a2 + 1;
if (arg5 == temp_a3->unk6) {
temp_f2 = temp_a3->unk0 - arg0;
temp_f14 = temp_a3->unk2 - arg1;
temp_f16 = temp_a3->unk4 - arg2;
temp_f18 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16);
if (temp_f18 < phi_f0) {
phi_f0 = temp_f18;
phi_v1_2 = temp_hi;
}
}
phi_a2 = temp_a2;
phi_v1 = phi_v1_2;
} while (temp_a2 < temp_t1);
}
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000C884.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFF4;
extern ? D_801645C8;
s16 func_8000C9DC(f32 arg0, f32 arg1, f32 arg2, s16 arg3, s32 arg4) {
f32 temp_f14;
f32 temp_f16;
f32 temp_f18;
f32 temp_f2;
s16 temp_t0;
s16 temp_t0_2;
s16 temp_t1;
s32 temp_hi;
s32 temp_t3;
u16 temp_a0;
void *temp_a3;
s16 phi_t0;
f32 phi_f0;
s32 phi_v0;
s16 phi_t0_2;
s16 phi_v1;
s32 phi_v0_2;
s16 phi_v1_2;
temp_t1 = arg3 - 3;
temp_t3 = arg3 + 7;
temp_a0 = *(&D_801645C8 + (arg4 * 2));
phi_t0 = temp_t1;
phi_f0 = D_800ECFF4;
phi_v0 = 0;
phi_v1 = -1;
phi_v0_2 = 0;
phi_v1_2 = -1;
if (temp_t1 < temp_t3) {
do {
temp_hi = (phi_t0 + temp_a0) % temp_a0;
temp_a3 = (temp_hi * 8) + (&D_80164550)[arg4];
temp_t0 = phi_t0 + 1;
temp_f2 = temp_a3->unk0 - arg0;
temp_f14 = temp_a3->unk2 - arg1;
temp_f16 = temp_a3->unk4 - arg2;
temp_f18 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16);
if (temp_f18 < phi_f0) {
phi_f0 = temp_f18;
phi_v0_2 = 1;
phi_v1_2 = temp_hi;
}
phi_t0 = temp_t0;
phi_v0 = phi_v0_2;
phi_v1 = phi_v1_2;
} while (temp_t0 < temp_t3);
}
if (phi_v0 == 0) {
phi_t0_2 = temp_t1;
if (temp_t1 < temp_t3) {
do {
temp_t0_2 = phi_t0_2 + 1;
phi_t0_2 = temp_t0_2;
} while (temp_t0_2 < temp_t3);
}
}
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000C9DC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_8000CBA4(f32 arg0, f32 arg1, ? arg2, s16 *arg3) {
s16 temp_v0;
s16 phi_v0;
temp_v0 = *arg3;
phi_v0 = temp_v0;
if ((gCurrentCourseId == 0xE) && (temp_v0 >= 0x475) && (temp_v0 < 0x480) && (arg1 < 0.0f)) {
phi_v0 = 0x398;
}
*arg3 = phi_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000CBA4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_8016344C;
extern ? D_801645C8;
void func_8000CBF8(f32 arg0, f32 arg1, f32 arg2, s16 *arg3, s32 arg4) {
s16 temp_v0;
s16 phi_v0;
temp_v0 = *arg3;
phi_v0 = temp_v0;
if (temp_v0 == 0) {
if (D_8016344C < arg2) {
phi_v0 = *(&D_801645C8 + (arg4 * 2)) - 1;
}
} else if (((temp_v0 + 1) == *(&D_801645C8 + (arg4 * 2))) && (arg2 <= D_8016344C)) {
phi_v0 = 0;
}
*arg3 = phi_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000CBF8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000C0BC(f32, f32, s32, s32, u16, s32 *); // extern
s32 func_802ABD40(u16); // extern
extern ? D_80163318;
extern ? D_801645B0;
void func_8000CC88(f32 arg0, f32 arg1, s32 arg2, void *arg3, s32 arg4, s32 *arg5) {
s32 sp20;
s32 temp_a0;
s32 temp_t8;
s32 temp_v0;
u16 phi_a3;
temp_v0 = func_802ABD40(arg3->unk11A);
temp_a0 = temp_v0 & 0xFFFF;
phi_a3 = temp_v0 & 0xFFFF;
if ((temp_a0 <= 0) || (temp_a0 >= 0x33)) {
phi_a3 = *(&D_80163318 + (arg4 * 2));
}
temp_t8 = arg4 * 2;
*(&D_80163318 + temp_t8) = phi_a3;
sp20 = temp_t8;
func_8000C0BC(arg0, arg1, temp_a0, arg2, phi_a3, arg5);
*(&D_801645B0 + sp20) = *arg5;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000CC88.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8000BD94(f32, f32, void *, s32); // extern
s16 func_8000C0BC(f32, f32, void *, u16, s32 *); // extern
s16 func_8000C884(f32, f32, void *, s16, s32, s32); // extern
s16 func_8000C9DC(f32, f32, void *, s16, s32, s32); // extern
? func_8000CBA4(f32, f32, void *, s16 *, s32); // extern
? func_8000CBF8(f32, f32, void *, s16 *, s32); // extern
s16 func_8000CC88(f32, f32, void *, void *, s32, s32 *); // extern
s32 func_802ABD40(u16); // extern
? func_802ADDC8(void *, ?, f32, f32, void *); // extern
extern ? D_801631E0;
extern ? D_80163318;
extern s32 D_80163488;
s16 func_8000CD24(f32 arg0, f32 arg1, void *arg2, s16 arg3, void *arg4, s32 arg5, s32 arg6) {
s16 sp5E;
s32 sp48;
u16 *sp44;
f32 temp_f20;
f32 temp_f22;
f32 temp_f24;
s16 temp_a0;
s16 temp_v0_2;
s16 temp_v0_4;
s16 temp_v0_5;
s16 temp_v0_6;
s16 temp_v0_7;
s16 temp_v0_8;
s16 temp_v0_9;
s32 temp_t0;
s32 temp_t2;
s32 temp_t4;
s32 temp_t8;
u16 *temp_v1_2;
u16 temp_v0;
u16 temp_v0_3;
void *temp_a0_2;
void *temp_v1;
void *temp_v1_3;
void *temp_v1_4;
s16 phi_v0;
f32 phi_f20;
f32 phi_f22;
void *phi_f24;
f32 phi_f20_2;
f32 phi_f22_2;
void *phi_f24_2;
temp_v0 = arg4->unk0;
phi_f20 = arg0;
phi_f22 = arg1;
phi_f24 = arg2;
phi_f20_2 = arg0;
phi_f22_2 = arg1;
phi_f24_2 = arg2;
if (((temp_v0 & 0x4000) != 0) && ((temp_v0 & 0x1000) == 0)) {
temp_v0_2 = func_8000C884(arg0, arg1, arg2, arg3, arg6, func_802ABD40(arg4->unk11A));
sp5E = temp_v0_2;
if (temp_v0_2 == -1) {
sp5E = func_8000CC88(arg0, arg1, arg2, arg4, arg5, &arg6);
}
goto block_17;
}
temp_t0 = arg5 * 2;
sp48 = temp_t0;
if (*(&D_801631E0 + temp_t0) == 1) {
temp_a0 = arg4->unkCA;
if ((temp_a0 & 1) != 0) {
temp_v1 = (&D_80164550)[arg6] + (arg3 * 8);
arg4->unk14 = temp_v1->unk0;
arg4->unk18 = temp_v1->unk2;
arg4->unkCA = temp_a0 & 0xFFFE;
arg4->unk1C = temp_v1->unk4;
return arg3;
}
temp_a0_2 = arg4 + 0x110;
if (arg5 == (D_80163488 % 8)) {
func_802ADDC8(temp_a0_2, 0x41200000, arg0, arg1, arg2);
temp_v0_3 = func_802ABD40(arg4->unk11A);
temp_t8 = temp_v0_3 & 0xFFFF;
temp_v1_2 = sp48 + &D_80163318;
*temp_v1_2 = temp_v0_3;
sp44 = temp_v1_2;
temp_v0_4 = func_8000C884(arg0, arg1, arg2, arg3, arg6, temp_t8);
sp5E = temp_v0_4;
phi_v0 = temp_v0_4;
if (temp_v0_4 == -1) {
sp44 = temp_v1_2;
temp_v0_5 = func_8000C9DC(arg0, arg1, arg2, arg3, arg6);
sp5E = temp_v0_5;
phi_v0 = temp_v0_5;
}
if (phi_v0 == -1) {
temp_v0_6 = func_8000C0BC(arg0, arg1, arg2, *(sp48 + &D_80163318), &arg6);
temp_t4 = temp_v0_6 * 8;
sp5E = temp_v0_6;
temp_v1_3 = (&D_80164550)[arg6] + temp_t4;
arg4->unk14 = temp_v1_3->unk0;
arg4->unk18 = temp_v1_3->unk2;
arg4->unk1C = temp_v1_3->unk4;
}
} else {
temp_v0_7 = func_8000C9DC(arg0, arg1, temp_a0_2, arg2, arg3, arg6);
sp5E = temp_v0_7;
if (temp_v0_7 == -1) {
temp_v0_8 = func_8000BD94(arg0, arg1, arg2, arg6);
temp_t2 = temp_v0_8 * 8;
sp5E = temp_v0_8;
temp_v1_4 = (&D_80164550)[arg6] + temp_t2;
temp_f20 = temp_v1_4->unk0;
temp_f22 = temp_v1_4->unk2;
arg4->unk14 = temp_f20;
temp_f24 = temp_v1_4->unk4;
arg4->unk18 = temp_f22;
arg4->unk1C = temp_f24;
func_802ADDC8(arg4 + 0x110, 0x41200000, temp_f20, temp_f22, (bitwise void *) temp_f24);
*(&D_80163318 + sp48) = func_802ABD40(arg4->unk11A);
phi_f20 = temp_f20;
phi_f22 = temp_f22;
phi_f24 = (bitwise void *) temp_f24;
}
}
goto block_16;
}
temp_v0_9 = func_8000C9DC(arg0, arg1, arg2, arg3, arg6);
sp5E = temp_v0_9;
if (temp_v0_9 == -1) {
sp5E = func_8000CC88(arg0, arg1, arg2, arg4, arg5, &arg6);
}
block_16:
func_8000CBA4(phi_f20, phi_f22, phi_f24, &sp5E, arg6);
phi_f20_2 = phi_f20;
phi_f22_2 = phi_f22;
phi_f24_2 = phi_f24;
block_17:
func_8000CBF8(phi_f20_2, phi_f22_2, phi_f24_2, &sp5E, arg6);
return sp5E;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000CD24.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFF8;
extern s32 D_80163598;
extern s32 D_8016359C;
s16 func_8000D100(f32 arg0, f32 arg1, f32 arg2, s16 arg3) {
f32 temp_f14;
f32 temp_f16;
f32 temp_f2;
s16 temp_a0;
s16 temp_v0;
s32 temp_a1;
s32 temp_a2;
s32 temp_hi;
void *temp_t0;
s16 phi_v0;
s32 phi_a0;
f32 phi_f0;
s16 phi_v1;
s16 phi_v1_2;
s16 phi_v1_3;
temp_a0 = arg3 - 2;
temp_a1 = arg3 + 7;
phi_v0 = temp_a0;
phi_f0 = D_800ECFF8;
phi_v1 = -1;
phi_v1_3 = -1;
if (temp_a0 < temp_a1) {
temp_a2 = D_8016359C;
do {
phi_a0 = phi_v0;
if (phi_v0 < 0) {
phi_a0 = phi_v0 + temp_a2;
}
temp_hi = phi_a0 % temp_a2;
temp_t0 = (temp_hi * 4) + D_80163598;
temp_v0 = phi_v0 + 1;
temp_f2 = temp_t0->unk0 - arg0;
temp_f14 = temp_t0->unk2 - arg2;
temp_f16 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14);
if (temp_f16 < phi_f0) {
phi_f0 = temp_f16;
phi_v1_3 = temp_hi;
}
phi_v0 = temp_v0;
phi_v1 = phi_v1_3;
} while (temp_v0 < temp_a1);
}
phi_v1_2 = phi_v1;
if (phi_v1 == -1) {
phi_v1_2 = arg3;
}
return phi_v1_2;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D100.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000C0BC(f32, f32, ?32, s32, s32); // extern
s32 func_802ABD40(u16); // extern
? func_802ADDC8(? *, ?, f32, f32, ?32); // extern
void func_8000D24C(f32 arg0, f32 arg1, ?32 arg2, s32 arg3) {
? sp24;
func_802ADDC8(&sp24, 0x41200000, arg0, arg1, arg2);
func_8000C0BC(arg0, arg1, arg2, func_802ABD40(sp2E) & 0xFFFF, arg3);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D24C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8000C9DC(f32, f32, s16, s32); // extern
? func_8000CBF8(f32, f32, s32, s16 *, s32); // extern
s16 func_8000D24C(f32, f32, s32, s32 *); // extern
s16 func_8000D2B4(f32 arg0, f32 arg1, s32 arg2, s16 arg3, s32 arg4) {
s16 sp26;
s16 temp_v0;
temp_v0 = func_8000C9DC(arg0, arg1, arg3, arg4);
sp26 = temp_v0;
if (temp_v0 == -1) {
sp26 = func_8000D24C(arg0, arg1, arg2, &arg4);
}
func_8000CBF8(arg0, arg1, arg2, &sp26, arg4);
return sp26;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D2B4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8000C9DC(f32, f32, s16, s32); // extern
s16 func_8000D24C(f32, f32, s32, s32 *); // extern
s16 func_8000D33C(f32 arg0, f32 arg1, s32 arg2, s16 arg3, s32 arg4) {
s16 temp_v0;
s16 phi_v1;
temp_v0 = func_8000C9DC(arg0, arg1, arg3, arg4);
phi_v1 = temp_v0;
if (temp_v0 == -1) {
phi_v1 = func_8000D24C(arg0, arg1, arg2, &arg4);
}
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D33C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801634F8;
f32 func_8000D3B8(s32 arg0) {
f32 temp_f0;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
void *temp_v0;
f32 phi_f2;
temp_v0 = (arg0 * 0x10) + &D_801634F8;
temp_f2 = temp_v0->unk0;
temp_f0 = temp_v0->unk4;
phi_f2 = temp_f2;
if (temp_f2 < temp_f0) {
temp_f2_2 = temp_f2 + temp_v0->unk8;
phi_f2 = temp_f2_2;
if (temp_f0 < temp_f2_2) {
goto block_5;
}
} else if (temp_f0 < temp_f2) {
temp_f2_3 = temp_f2 - temp_v0->unk8;
phi_f2 = temp_f2_3;
if (temp_f2_3 < temp_f0) {
block_5:
phi_f2 = temp_f0;
}
}
temp_v0->unk0 = phi_f2;
return phi_f2;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D3B8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8000B820(s32); // extern
? func_8000BBD8(s32, f32, s16, u16); // extern
f32 func_8000D3B8(s32, u16); // extern
extern ? D_80162FA0;
extern ? D_80163068;
extern s32 D_801631D8;
extern ? D_80163380;
extern s16 D_8016344A;
extern u16 D_80164430;
extern s32 D_801645E0;
void func_8000D438(s32 arg0, u16 arg1) {
f32 sp48;
f32 sp44;
f32 sp2C;
s32 sp28;
s16 sp26;
s32 sp1C;
f32 temp_f0;
s16 *temp_v1_2;
s16 temp_v0;
s16 temp_v0_2;
s16 temp_v1;
s32 temp_a0;
s32 temp_hi;
s32 temp_t0;
u16 temp_a3;
u16 temp_a3_2;
s32 phi_a2;
s32 phi_a2_2;
s32 phi_a2_3;
s32 phi_v0;
temp_a3 = arg1 & 0xFFFF;
temp_t0 = temp_a3 * 2;
temp_v1 = *(D_801645E0 + temp_t0);
sp28 = 6;
sp1C = temp_t0;
arg1 = temp_a3;
sp26 = temp_v1;
temp_v0 = gCurrentCourseId;
sp2C = func_8000D3B8(6, temp_a3);
phi_a2 = 6;
if (temp_v0 != 4) {
if (temp_v0 != 0xA) {
if (temp_v0 == 0x14) {
phi_a2 = 1;
} else if (temp_v1 < 6) {
phi_a2 = 8;
} else if (temp_v1 >= 0x15) {
phi_a2 = 0x14;
}
} else {
phi_a2 = 7;
}
}
phi_a2_2 = phi_a2;
phi_a2_2 = phi_a2;
if (phi_a2 >= 8) {
temp_f0 = *(&D_80163068 + (arg0 * 4));
if ((temp_f0 > 0.75f) && (*(D_801631D8 + temp_t0) == 0)) {
phi_a2_2 = 7;
}
if ((temp_f0 < -0.75f) && (*(D_801631D8 + temp_t0) == 1)) {
phi_a2_2 = 7;
}
}
sp28 = phi_a2_2;
arg1 = arg1;
temp_a3_2 = arg1;
phi_a2_3 = phi_a2_2;
if (func_8000B820(arg0) == 1) {
phi_a2_3 = 5;
}
temp_v1_2 = (arg0 * 2) + &D_80163380;
temp_v0_2 = *temp_v1_2;
if (temp_v0_2 < phi_a2_3) {
*temp_v1_2 = temp_v0_2 + 1;
}
phi_v0 = *temp_v1_2;
if (phi_a2_3 < *temp_v1_2) {
*temp_v1_2 = *temp_v1_2 - 1;
phi_v0 = *temp_v1_2;
}
temp_hi = (phi_v0 + temp_a3_2) % D_80164430;
temp_a0 = temp_hi & 0xFFFF;
arg1 = temp_hi;
func_8000BBD8(temp_a0, sp2C, D_8016344A, temp_a3_2);
sp48 = D_80162FA0.unk0;
sp44 = D_80162FA0.unk8;
func_8000BBD8(((arg1 + 1) % D_80164430) & 0xFFFF, sp2C, D_8016344A, arg1);
D_80162FA0.unk0 = (sp48 + D_80162FA0.unk0) * 0.5f;
D_80162FA0.unk8 = (sp44 + D_80162FA0.unk8) * 0.5f;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D438.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80005FD0(f32, f32, f32 *, void *); // extern
? func_8000BBD8(u16, s32, s16, u16); // extern
s16 func_8000D2B4(f32, f32, f32, s16, s32); // extern
extern f32 D_800ECFFC;
extern ? D_80162FA0;
extern ? D_801645C8;
void func_8000D6D0(void *arg0, s16 *arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5) {
s16 spA0;
u16 sp9E;
f32 sp98;
f32 sp90;
f32 sp58;
f32 sp54;
f32 sp50;
s16 *sp4C;
f32 sp48;
f32 sp44;
f32 sp40;
f32 temp_f0;
f32 temp_f16;
f32 temp_f18;
f32 temp_f20;
f32 temp_f22;
f32 temp_f24;
f32 temp_f4;
f32 temp_f4_2;
s16 temp_v0;
s32 temp_hi;
s32 temp_v1;
u16 temp_a3;
f32 phi_f2;
f32 phi_f12;
f32 phi_f14;
sp4C = (&D_80164550)[arg4];
sp50 = arg0->unk0;
sp54 = arg0->unk4;
sp58 = arg0->unk8;
temp_f24 = arg0->unk8;
temp_f20 = arg0->unk0;
temp_f22 = arg0->unk4;
temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *arg1, arg4);
*arg1 = temp_v0;
temp_a3 = *(&D_801645C8 + (arg4 * 2));
temp_v1 = temp_v0 + arg5;
temp_hi = temp_v1 % temp_a3;
sp9E = (temp_v1 + 1) % temp_a3;
spA0 = temp_hi;
func_8000BBD8(temp_hi & 0xFFFF, arg3, arg4, temp_a3);
temp_f4 = D_80162FA0.unk8;
sp98 = D_80162FA0.unk0;
sp90 = temp_f4;
func_8000BBD8(sp9E, arg3, arg4);
temp_f18 = (((sp4C + (sp9E * 8))->unk2 + (sp4C + (spA0 * 8))->unk2) * 0.5f) - temp_f22;
temp_f16 = ((sp98 + D_80162FA0.unk0) * 0.5f) - temp_f20;
sp44 = temp_f18;
sp48 = temp_f16;
temp_f4_2 = ((temp_f4 + D_80162FA0.unk8) * 0.5f) - temp_f24;
sp40 = temp_f4_2;
temp_f0 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18) + (temp_f4_2 * temp_f4_2));
if (D_800ECFFC < temp_f0) {
phi_f2 = ((temp_f16 * arg2) / temp_f0) + temp_f20;
phi_f12 = ((temp_f18 * arg2) / temp_f0) + temp_f22;
phi_f14 = ((sp40 * arg2) / temp_f0) + temp_f24;
} else {
phi_f2 = temp_f20;
phi_f12 = temp_f22;
phi_f14 = temp_f24;
}
arg0->unk0 = phi_f2;
arg0->unk4 = phi_f12;
arg0->unk8 = phi_f14;
func_80005FD0(phi_f12, phi_f14, &sp50, arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D6D0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80005FD0(f32, f32, f32 *, void *); // extern
? func_8000BBD8(u16, s32, s16, s32); // extern
s16 func_8000D2B4(f32, f32, f32, s16, s32); // extern
extern f32 D_800ED000;
extern ? D_80162FA0;
extern ? D_801645C8;
void func_8000D940(void *arg0, s16 *arg1, f32 arg2, s32 arg3, s16 arg4) {
s16 spA8;
u16 spA6;
f32 spA0;
f32 sp98;
s32 sp60;
f32 sp5C;
f32 sp58;
f32 sp54;
f32 sp50;
f32 sp4C;
f32 sp48;
f32 temp_f0;
f32 temp_f16;
f32 temp_f18;
f32 temp_f20;
f32 temp_f22;
f32 temp_f24;
f32 temp_f4;
f32 temp_f4_2;
s16 *temp_v0_2;
s16 temp_v0;
s32 temp_a3;
s32 temp_t2;
s32 temp_v1;
u16 temp_t0;
f32 phi_f2;
f32 phi_f12;
f32 phi_f14;
sp54 = arg0->unk0;
sp58 = arg0->unk4;
temp_t0 = *(&D_801645C8 + (arg4 * 2));
sp5C = arg0->unk8;
temp_f24 = arg0->unk8;
temp_f20 = arg0->unk0;
temp_f22 = arg0->unk4;
sp60 = temp_t0;
temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *arg1, arg4);
temp_v1 = temp_v0 + temp_t0;
temp_t2 = temp_v1 - 4;
temp_a3 = (temp_v1 - 3) % temp_t0;
*arg1 = temp_v0;
spA8 = temp_a3;
spA6 = temp_t2 % temp_t0;
func_8000BBD8(temp_a3 & 0xFFFF, arg3, arg4, temp_a3);
temp_f4 = D_80162FA0.unk8;
spA0 = D_80162FA0.unk0;
sp98 = temp_f4;
func_8000BBD8(spA6, arg3, arg4);
temp_v0_2 = (&D_80164550)[arg4];
temp_f18 = (((temp_v0_2 + (spA6 * 8))->unk2 + (temp_v0_2 + (spA8 * 8))->unk2) * 0.5f) - temp_f22;
temp_f16 = ((spA0 + D_80162FA0.unk0) * 0.5f) - temp_f20;
sp4C = temp_f18;
sp50 = temp_f16;
temp_f4_2 = ((temp_f4 + D_80162FA0.unk8) * 0.5f) - temp_f24;
sp48 = temp_f4_2;
temp_f0 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18) + (temp_f4_2 * temp_f4_2));
if (D_800ED000 < temp_f0) {
phi_f2 = ((temp_f16 * arg2) / temp_f0) + temp_f20;
phi_f12 = ((temp_f18 * arg2) / temp_f0) + temp_f22;
phi_f14 = ((sp48 * arg2) / temp_f0) + temp_f24;
} else {
phi_f2 = temp_f20;
phi_f12 = temp_f22;
phi_f14 = temp_f24;
}
arg0->unk0 = phi_f2;
arg0->unk4 = phi_f12;
arg0->unk8 = phi_f14;
func_80005FD0(phi_f12, phi_f14, &sp54, arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000D940.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80005FD0(f32, f32, f32 *, void *); // extern
s16 func_8000D100(f32, f32, f32, s16); // extern
extern f32 D_800ED004;
extern s32 D_80163598;
extern s32 D_8016359C;
void func_8000DBAC(void *arg0, s16 *arg1, f32 arg2) {
f32 sp98;
f32 sp94;
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp34;
f32 sp30;
f32 temp_f0;
f32 temp_f12;
f32 temp_f14;
f32 temp_f16;
f32 temp_f18;
f32 temp_f2;
s16 temp_v0;
s32 temp_a1;
s32 temp_v1;
void *temp_a0;
void *temp_a2;
f32 phi_f12;
f32 phi_f14;
temp_f12 = arg0->unk0;
temp_f14 = arg0->unk4;
temp_f2 = arg0->unk8;
sp38 = temp_f12;
sp3C = arg0->unk4;
sp40 = arg0->unk8;
sp98 = temp_f14;
sp94 = temp_f2;
temp_v0 = func_8000D100(temp_f12, temp_f14, temp_f2, *arg1);
*arg1 = temp_v0;
temp_v1 = D_8016359C;
temp_a1 = D_80163598;
temp_a0 = (((temp_v0 + 3) % temp_v1) * 4) + temp_a1;
temp_a2 = (((temp_v0 + 4) % temp_v1) * 4) + temp_a1;
temp_f16 = ((temp_a0->unk0 + temp_a2->unk0) * 0.5f) - temp_f12;
temp_f18 = ((temp_a0->unk2 + temp_a2->unk2) * 0.5f) - temp_f2;
sp34 = temp_f16;
sp30 = temp_f18;
temp_f0 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18));
if (D_800ED004 < temp_f0) {
phi_f12 = ((temp_f16 * arg2) / temp_f0) + temp_f12;
phi_f14 = ((temp_f18 * arg2) / temp_f0) + temp_f2;
} else {
phi_f12 = temp_f12;
phi_f14 = temp_f2;
}
arg0->unk0 = phi_f12;
arg0->unk8 = phi_f14;
arg0->unk4 = sp98;
func_80005FD0(phi_f12, phi_f14, &sp38, arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DBAC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802ADDC8(? *, ?, f32, f32, f32); // extern
extern ? D_800DCC08;
extern ? D_80163DE8;
extern ? D_80164038;
extern ? D_801641F8;
void func_8000DD78(void) {
? *temp_s2;
f32 temp_f20;
f32 temp_f22;
s16 temp_v0;
void *temp_s1;
void *temp_v0_2;
void *temp_v0_3;
s32 phi_s3;
f32 phi_f20;
? *phi_s0;
f32 phi_f2;
f32 phi_f22;
? *phi_s2;
phi_s3 = 0;
phi_s0 = &D_80163DE8;
phi_s2 = &D_80164038;
do {
temp_v0 = gCurrentCourseId;
temp_s1 = &D_800DCC08 + (temp_v0 * 0xA8) + phi_s3;
if (temp_v0 != 4) {
if (temp_v0 != 0x14) {
temp_v0_2 = D_80164550.unk0 + (temp_s1->unk0 * 8);
phi_f20 = temp_v0_2->unk0;
phi_f2 = temp_v0_2->unk2;
phi_f22 = temp_v0_2->unk4;
} else {
temp_v0_3 = D_80164550.unkC + (temp_s1->unk0 * 8);
phi_f20 = temp_v0_3->unk0;
phi_f2 = temp_v0_3->unk2;
phi_f22 = temp_v0_3->unk4;
}
} else {
temp_f22 = temp_s1->unkC;
temp_f20 = temp_s1->unk8;
phi_f20 = temp_f20;
phi_f2 = func_802AE1C0(temp_f20, 2000.0f, temp_f22);
phi_f22 = temp_f22;
}
phi_s0->unk0 = phi_f20;
phi_s0->unk4 = phi_f2;
phi_s0->unk8 = phi_f22;
phi_s0->unkC = phi_f20;
phi_s0->unk10 = phi_f2;
phi_s0->unk14 = phi_f22;
phi_s0->unk18 = phi_f20;
phi_s0->unk1C = phi_f2;
phi_s0->unk20 = phi_f22;
phi_s0->unk24 = phi_f20;
phi_s0->unk28 = phi_f2;
phi_s0->unk2C = phi_f22;
phi_s0->unk30 = phi_f20;
phi_s0->unk34 = phi_f2;
phi_s0->unk38 = phi_f22;
phi_s0->unk42 = temp_s1->unk0;
phi_s0->unk46 = 0;
phi_s0->unk48 = 0;
phi_s0->unk3C = temp_s1->unk4;
phi_s0->unk4A = 0;
phi_s0->unk4C = 1;
phi_s0->unk50 = phi_f2;
phi_s0->unk44 = temp_s1->unk2;
func_802ADDC8(phi_s2, 0x40000000, phi_f20, phi_f2, phi_f22);
temp_s2 = phi_s2 + 0x40;
phi_s3 += 0x18;
phi_s0 += 0x54;
phi_s2 = temp_s2;
} while (temp_s2 != &D_801641F8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DD78.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
f32 func_802ABE30(f32, ?, void *, f32, u16); /* extern */
? func_802ADDC8(void *, ?, f32, f32, f32); /* extern */
s32 func_802B5224(? *, ? *, ? *, u16); /* extern */
f32 sins(s32, s32, s32); /* extern */
f32 coss(s32, s32, s32, s32); /* extern */
f32 sqrtf(f32, f32, ? *, ? *); /* extern */
extern ? D_80162FB0;
extern ? D_80162FC0;
extern ? D_80163DE8;
extern ? D_80164038;
s16 gCurrentCourseId; /* unable to generate initializer */
void func_8000DF8C(s32 arg0, f32 arg1, s32 arg2, s32 arg3) {
f32 sp118;
f32 sp114;
void *sp110;
f32 sp108;
f32 spF8;
f32 spF0;
u16 spCA;
f32 spC4;
u16 spC2;
f32 spAC;
f32 spA0;
f32 sp94;
f32 sp88;
u16 sp7E;
u16 sp7C;
s32 sp4C;
s32 sp48;
s32 sp44;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f0_5;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f12_4;
f32 temp_f12_5;
f32 temp_f12_6;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f18;
f32 temp_f18_2;
f32 temp_f18_3;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f20_3;
f32 temp_f20_4;
f32 temp_f20_5;
f32 temp_f22;
f32 temp_f22_2;
f32 temp_f22_3;
f32 temp_f24;
f32 temp_f24_2;
f32 temp_f24_3;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
f32 temp_f6;
f64 temp_f10;
f64 temp_f4;
f64 temp_f8;
s32 temp_a0;
s32 temp_a0_2;
s32 temp_a0_3;
s32 temp_a0_4;
s32 temp_a3_2;
s32 temp_t0;
s32 temp_t2;
s32 temp_t2_2;
s32 temp_t4;
s32 temp_t6;
s32 temp_t7;
s32 temp_t7_2;
s32 temp_t9_2;
s32 temp_v0_3;
s8 temp_v1;
u16 temp_a3;
u16 temp_s1;
u16 temp_t9;
u16 temp_v0_5;
void *temp_a0_5;
void *temp_s0;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_4;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v1_2;
void *temp_v1_3;
Player *phi_v0;
s32 phi_a0;
s32 phi_v1;
s32 phi_s1;
s32 phi_a1;
s32 phi_a2;
s32 phi_a3;
f32 phi_f22;
f32 phi_f24;
f32 phi_f20;
s32 phi_s1_2;
f32 phi_f12;
f32 phi_f20_2;
f32 phi_f18;
f32 phi_f22_2;
f32 phi_f24_2;
f32 phi_f20_3;
u16 phi_s1_3;
s32 phi_s1_4;
f32 phi_f6;
temp_s0 = (arg0 * 0x54) + &D_80163DE8;
temp_t9 = temp_s0->unk44;
temp_t2 = temp_t9 & 0xFFFF;
sp4C = temp_t2;
sp7E = temp_t9;
phi_a1 = (bitwise s32) arg1;
phi_a2 = arg2;
phi_a3 = arg3;
if ((temp_t2 != 0) && ((temp_s0->unk4A != 1) || (gCurrentCourseId == 0x14))) {
temp_f22 = temp_s0->unk0;
temp_f20 = temp_s0->unk4;
temp_f24 = temp_s0->unk8;
spCA = temp_s0->unk42;
spC4 = temp_s0->unk3C;
spC2 = temp_s0->unk40;
sp7C = temp_s0->unk46;
temp_s1 = temp_s0->unk48;
phi_s1 = temp_s1;
phi_f22_2 = temp_f22;
phi_f24_2 = temp_f24;
phi_f20_2 = temp_f20;
phi_f22_2 = temp_f22;
phi_f24_2 = temp_f24;
phi_s1_4 = temp_s1;
if ((sp4C != 0) && (sp4C != 4)) {
if (gCurrentCourseId == 0x14) {
if (D_8016347E == 1) {
temp_v0 = gPlayerFour;
temp_f0 = temp_f22 - temp_v0->unk14;
temp_f2 = temp_f20 - temp_v0->unk18;
temp_f12 = temp_f24 - temp_v0->unk1C;
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f12 * temp_f12)) < 25.0f) {
sp7E = 4;
temp_v0->unkC = temp_v0->unkC | 0x400000;
temp_v0->unk0 = temp_v0->unk0 & ~0x2000;
sp4C = 4;
phi_s1 = 0;
phi_a1 = 0x400000;
}
}
} else {
temp_v1 = D_8018EDF3;
phi_a0 = 0;
phi_v1 = temp_v1;
if (temp_v1 > ZERO_PLAYERS_SELECTED) {
phi_v0 = gPlayers;
phi_a2 = 0x80000000;
phi_a3 = 5;
do {
temp_a0 = phi_a0 + 1;
phi_a0 = temp_a0;
if ((phi_v0->unk_0BC & 0x80000000) == 0) {
temp_f0_2 = temp_f22 - phi_v0->posX;
temp_f2_2 = temp_f20 - phi_v0->posY;
temp_f12_2 = temp_f24 - phi_v0->posZ;
if (((temp_f0_2 * temp_f0_2) + (temp_f2_2 * temp_f2_2) + (temp_f12_2 * temp_f12_2)) < 25.0f) {
sp7E = 4;
phi_s1_4 = 0;
if (gCurrentCourseId == 5) {
phi_v0->unk_00C |= 0x1000000;
} else {
phi_v0->unk_00C |= 0x400000;
}
phi_v1 = D_8018EDF3;
}
}
phi_v0 += 0xDD8;
phi_s1 = phi_s1_4;
} while (temp_a0 < phi_v1);
sp4C = sp7E;
phi_a1 = 0x400000;
}
}
}
phi_s1_2 = phi_s1;
phi_s1_2 = phi_s1;
switch (sp4C) {
case 1:
temp_t4 = ((phi_s1 + 0x164) % 360) & 0xFFFF;
temp_t6 = ((temp_t4 * 0xFFFF) / 360) & 0xFFFF;
sp48 = temp_t4;
sp44 = temp_t6;
sp118 = coss(temp_t6, phi_a1, phi_a2, phi_a3) * 25.0;
temp_f0_3 = sins(sp44);
temp_v0_2 = D_80164550 + (spCA * 8);
temp_f20_2 = temp_s0->unk50 + 3.5f;
temp_t7 = ((((sp48 + 1) % 360) * 0xFFFF) / 360) & 0xFFFF;
temp_f22_2 = temp_v0_2->unk0 + sp118;
D_80162FB0.unk4 = temp_f20_2;
D_80162FB0.unk0 = temp_f22_2;
sp44 = temp_t7;
sp110 = temp_v0_2;
temp_f24_2 = temp_v0_2->unk4 + (temp_f0_3 * 25.0);
D_80162FB0.unk8 = temp_f24_2;
sp118 = coss(temp_t7) * 25.0;
temp_f10 = sins(sp44);
D_80162FC0.unk0 = temp_v0_2->unk0 + sp118;
D_80162FC0.unk4 = temp_v0_2->unk2;
D_80162FC0.unk8 = temp_v0_2->unk4 + (temp_f10 * 25.0);
spC2 = (func_802B5224(&D_80162FB0, &D_80162FC0, &D_80162FB0) * 0xFFFF) / 65520;
phi_s1_2 = temp_t4;
phi_f20_2 = temp_f20_2;
phi_f22_2 = temp_f22_2;
phi_f24_2 = temp_f24_2;
break;
case 2:
temp_v0_3 = ((phi_s1 + 4) % 360) & 0xFFFF;
temp_a0_2 = ((temp_v0_3 * 0xFFFF) / 360) & 0xFFFF;
sp44 = temp_a0_2;
sp48 = temp_v0_3;
sp118 = coss(temp_a0_2, phi_a1, phi_a2, phi_a3) * 25.0;
temp_v0_4 = D_80164550 + (spCA * 8);
temp_f22_3 = temp_v0_4->unk0 + sp118;
temp_f20_3 = temp_s0->unk50 + 3.5f;
temp_f4 = sins(temp_a0_2) * 25.0;
temp_a0_3 = ((((sp48 + 1) % 360) * 0xFFFF) / 360) & 0xFFFF;
D_80162FB0.unk0 = temp_f22_3;
D_80162FB0.unk4 = temp_f20_3;
sp44 = temp_a0_3;
sp110 = temp_v0_4;
temp_f24_3 = temp_v0_4->unk4 + temp_f4;
D_80162FB0.unk8 = temp_f24_3;
sp118 = coss(temp_a0_3) * 25.0;
temp_f8 = sins(temp_a0_3);
D_80162FC0.unk0 = temp_v0_4->unk0 + sp118;
D_80162FC0.unk4 = temp_v0_4->unk2;
D_80162FC0.unk8 = temp_v0_4->unk4 + (temp_f8 * 25.0);
spC2 = (func_802B5224(&D_80162FB0, &D_80162FC0, &D_80162FB0) * 0xFFFF) / 65520;
phi_s1_2 = temp_v0_3;
phi_f20_2 = temp_f20_3;
phi_f22_2 = temp_f22_3;
phi_f24_2 = temp_f24_3;
default:
block_42:
break;
case 3:
spC2 = 0;
phi_f20_2 = temp_s0->unk50 + 3.5f;
break;
case 5:
if ((D_8016347C == 0) || (D_8016443E < 5)) {
} else {
temp_v0_5 = func_8000D2B4(temp_f22, temp_f20, (bitwise s32) temp_f24, (bitwise f32) spCA, 4e-45.0f);
temp_a0_4 = temp_v0_5 & 0xFFFF;
spCA = temp_v0_5;
if ((temp_a0_4 < 0) || (D_801645CE < temp_a0_4)) {
spCA = 0;
}
if (spCA < 0x1A) {
temp_a3 = D_801645CE;
temp_t0 = D_8016455C;
temp_v0_6 = (((spCA + 1) % temp_a3) * 8) + temp_t0;
D_80162FB0.unk0 = temp_v0_6->unk0;
temp_v1_2 = (((spCA + 2) % temp_a3) * 8) + temp_t0;
D_80162FB0.unk4 = temp_v0_6->unk2;
D_80162FB0.unk8 = temp_v0_6->unk4;
D_80162FC0.unk0 = temp_v1_2->unk0;
D_80162FC0.unk4 = temp_v1_2->unk2;
D_80162FC0.unk8 = temp_v1_2->unk4;
spC2 = (func_802B5224(&D_80162FB0, &D_80162FC0, &D_80162FB0, temp_a3) * 0xFFFF) / 65520;
} else {
D_80162FB0.unk0 = temp_f22;
D_80162FB0.unk4 = temp_f20;
D_80162FB0.unk8 = temp_f24;
D_80162FC0.unk0 = -2409.197f;
D_80162FC0.unk4 = 0.0f;
D_80162FC0.unk8 = -355.254f;
spC2 = (func_802B5224(&D_80162FB0, &D_80162FC0, &D_80162FB0) * 0xFFFF) / 65520;
}
temp_f14 = ((D_80162FC0.unk0 + D_80162FB0.unk0) * 0.5f) - temp_f22;
spF8 = temp_f14;
temp_f16 = ((D_80162FC0.unk8 + D_80162FB0.unk8) * 0.5f) - temp_f24;
spF0 = temp_f16;
temp_f0_4 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16), temp_f14, &D_80162FC0, &D_80162FB0);
if (temp_f0_4 > 0.01f) {
temp_f2_3 = temp_s0->unk3C;
phi_f22 = temp_f22 + ((temp_f2_3 * temp_f14) / temp_f0_4);
phi_f24 = temp_f24 + ((temp_f2_3 * temp_f16) / temp_f0_4);
} else {
phi_f22 = temp_f22 + (temp_f14 / 5.0f);
phi_f24 = temp_f24 + (temp_f16 / 5.0f);
}
temp_a0_5 = (arg0 << 6) + &D_80164038;
sp48 = temp_a0_5;
temp_f20_4 = func_802ABE30(phi_f22, 0x44FA0000, temp_a0_5, phi_f24, temp_a0_5->unkA) + 3.5f;
phi_f20 = temp_f20_4;
phi_f22_2 = phi_f22;
phi_f24_2 = phi_f24;
if (temp_f20_4 < -1000.0) {
phi_f20 = temp_s0->unk4;
}
func_802ADDC8(temp_a0_5, 0x41200000, phi_f22, phi_f20, phi_f24);
phi_f20_2 = phi_f20;
}
goto block_42;
case 4:
temp_a3_2 = D_80164550;
temp_v0_7 = temp_a3_2 + (spCA * 8);
D_80162FB0.unk0 = temp_v0_7->unk0;
D_80162FB0.unk4 = temp_v0_7->unk2;
D_80162FB0.unk8 = temp_v0_7->unk4;
temp_v1_3 = (((spCA + 1) % D_801645C8) * 8) + temp_a3_2;
D_80162FC0.unk0 = temp_v1_3->unk0;
D_80162FC0.unk4 = temp_v1_3->unk2;
temp_f6 = phi_s1;
D_80162FC0.unk8 = temp_v1_3->unk4;
phi_f6 = temp_f6;
if (phi_s1 < 0) {
phi_f6 = temp_f6 + 4294967296.0f;
}
spC2 = (func_802B5224(&D_80162FB0, &D_80162FC0, &D_80162FB0, temp_a3_2) * 0xFFFF) / 65520;
phi_f20_2 = temp_f20 + (3.0f - (phi_f6 * 0.3f));
goto block_42;
}
phi_f20_3 = phi_f20_2;
phi_s1_3 = phi_s1_2;
if (sp4C == 4) {
temp_f12_3 = phi_s1_2;
phi_f12 = temp_f12_3;
if (phi_s1_2 < 0) {
phi_f12 = temp_f12_3 + 4294967296.0f;
}
sp4C = (bitwise s32) phi_f12;
temp_t7_2 = (0xFFFF - spC2) & 0xFFFF;
sp108 = 2.0f * phi_f12;
sp48 = temp_t7_2;
sp118 = coss((bitwise s32) phi_f12, temp_t7_2) * phi_f12;
temp_t9_2 = (phi_s1_2 + 1) & 0xFFFF;
temp_f18 = sins((bitwise s32) phi_f12, sp48) * phi_f12;
temp_f2_4 = (phi_f20_2 - 2.3f) + (sp108 / 3.0f);
spAC = temp_f2_4;
spA0 = temp_f2_4;
sp94 = temp_f2_4;
sp88 = temp_f2_4;
phi_f18 = temp_f18;
phi_s1_3 = temp_t9_2;
if (temp_t9_2 >= 0x1F) {
sp7E = 0;
phi_f18 = temp_f18;
}
} else {
temp_t2_2 = (0xFFFF - spC2) & 0xFFFF;
sp48 = temp_t2_2;
sp118 = coss(temp_t2_2) * 1.5f;
temp_f18_2 = sins(sp48) * 1.5f;
temp_f16_2 = phi_f20_2 - 2.3f;
temp_f12_4 = (sp7C % 3) * 0.15f;
temp_f14_2 = temp_f16_2 - temp_f12_4;
sp114 = temp_f18_2;
temp_f12_5 = temp_f16_2 + temp_f12_4;
spAC = temp_f14_2;
sp94 = temp_f14_2;
spA0 = temp_f12_5;
sp88 = temp_f12_5;
sp4C = sp7C;
temp_f18_3 = temp_f18_2;
temp_f20_5 = phi_f20_2 + sins((bitwise s32) temp_f12_5, (bitwise s32) temp_f14_2, ((sp7C * 0x13FFEC) / 360) & 0xFFFF);
sp7C = (sp7C + 1) % 18;
phi_f18 = temp_f18_3;
phi_f20_3 = temp_f20_5;
}
temp_f12_6 = -phi_f18;
temp_f0_5 = phi_f18 + sp118;
temp_s0->unkC = (sp118 - phi_f18) + phi_f22_2;
temp_s0->unk18 = temp_f0_5 + phi_f22_2;
temp_s0->unk10 = spAC;
temp_s0->unk14 = temp_f0_5 + phi_f24_2;
temp_f2_5 = -sp118;
temp_s0->unk1C = spA0;
temp_s0->unk20 = (phi_f18 - sp118) + phi_f24_2;
temp_s0->unk24 = (temp_f2_5 - phi_f18) + phi_f22_2;
temp_s0->unk2C = temp_f12_6 + sp118 + phi_f24_2;
temp_s0->unk28 = sp94;
temp_s0->unk30 = temp_f2_5 + phi_f18 + phi_f22_2;
temp_s0->unk0 = phi_f22_2;
temp_s0->unk38 = (temp_f12_6 - sp118) + phi_f24_2;
temp_s0->unk4 = phi_f20_3;
temp_s0->unk8 = phi_f24_2;
temp_s0->unk34 = sp88;
temp_s0->unk42 = spCA;
temp_s0->unk3C = spC4;
temp_s0->unk40 = spC2;
temp_s0->unk44 = sp7E;
temp_s0->unk48 = phi_s1_3;
temp_s0->unk46 = sp7C;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DF8C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801641F8;
extern ? D_801642D8;
? func_8000ED14(s16 arg0, s16 arg1) {
? *temp_a2;
? *phi_a2;
s32 phi_v0;
phi_a2 = &D_801641F8;
phi_v0 = 0;
loop_1:
if (phi_a2->unkC == 0) {
phi_a2->unkC = 1;
phi_a2->unkE = arg0;
phi_a2->unk10 = arg1;
phi_a2->unk14 = 0;
phi_v0 = 1;
} else {
temp_a2 = phi_a2 + 0x1C;
phi_a2 = temp_a2;
if (temp_a2 != &D_801642D8) {
goto loop_1;
}
}
if (phi_v0 == 0) {
return -2;
}
return 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000ED14.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8000ED14(?); // extern
extern ? D_8015F9B8;
s32 func_8000ED80(s32 arg0) {
if (*(&D_8015F9B8 + (arg0 * 0x70)) != 8) {
return -1;
}
return func_8000ED14(0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000ED80.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8000ED14(?); // extern
extern ? D_8015F9B8;
s32 func_8000EDC8(s32 arg0) {
if (*(&D_8015F9B8 + (arg0 * 0x70)) != 7) {
return -1;
}
return func_8000ED14(1);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000EDC8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8000ED14(?); // extern
extern ? D_8015F9B8;
s32 func_8000EE10(s32 arg0) {
if (*(&D_8015F9B8 + (arg0 * 0x70)) != 0x2A) {
return -1;
}
return func_8000ED14(2);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000EE10.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801641F8;
extern ? D_801642D8;
void func_8000EE58(s32 arg0) {
? *temp_v1;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_3;
? *phi_v1;
phi_v1 = &D_801641F8;
do {
temp_v0 = phi_v1 + 0x1C;
if (arg0 == phi_v1->unkE) {
phi_v1->unkC = 0;
phi_v1->unkE = 0x3E8;
}
if (arg0 == phi_v1->unk2A) {
temp_v0->unkC = 0;
temp_v0->unkE = 0x3E8;
}
temp_v0_2 = phi_v1 + 0x38;
if (arg0 == phi_v1->unk46) {
temp_v0_2->unkC = 0;
temp_v0_2->unkE = 0x3E8;
}
temp_v0_3 = phi_v1 + 0x54;
if (arg0 == phi_v1->unk62) {
temp_v0_3->unkC = 0;
temp_v0_3->unkE = 0x3E8;
}
temp_v1 = phi_v1 + 0x70;
phi_v1 = temp_v1;
} while (temp_v1 != &D_801642D8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000EE58.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801641F8;
extern ? D_801642D8;
void func_8000EEDC(void) {
? *temp_v1;
? *phi_v1;
phi_v1 = &D_801641F8;
do {
temp_v1 = phi_v1 + 0x70;
temp_v1->unk-48 = 0;
temp_v1->unk-46 = 0x3E8;
temp_v1->unk-2C = 0;
temp_v1->unk-2A = 0x3E8;
temp_v1->unk-10 = 0;
temp_v1->unk-E = 0x3E8;
temp_v1->unk-64 = 0;
temp_v1->unk-62 = 0x3E8;
phi_v1 = temp_v1;
} while (temp_v1 != &D_801642D8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000EEDC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80076D70(void *, f32, s16); // extern
extern f32 D_800ED040;
extern f32 D_800ED044;
extern f32 D_800ED048;
extern f32 D_800ED04C;
extern ? D_8015F9B8;
extern ? D_801641F8;
extern ? D_801642D8;
void func_8000EF20(void) {
? *temp_s0;
f32 temp_f22;
s16 temp_v0;
u32 temp_t0;
u32 temp_v0_2;
u32 temp_v0_3;
u32 temp_v0_4;
void *temp_s1;
? *phi_s0;
u32 phi_v0;
f32 phi_f20;
temp_f22 = D_800ED048;
phi_s0 = &D_801641F8;
do {
if (phi_s0->unkC == 1) {
temp_v0 = phi_s0->unk10;
temp_t0 = phi_s0->unk14 + 1;
phi_s0->unk14 = temp_t0;
temp_s1 = &D_8015F9B8 + (phi_s0->unkE * 0x70);
if (temp_v0 != 0) {
if (temp_v0 != 1) {
if (temp_v0 != 2) {
phi_v0 = temp_t0;
phi_f20 = 1.0f;
} else {
temp_v0_2 = phi_s0->unk14;
phi_v0 = temp_v0_2;
if (temp_v0_2 < 0xA) {
phi_f20 = temp_f22;
} else {
goto block_14;
}
}
} else {
temp_v0_3 = phi_s0->unk14;
phi_v0 = temp_v0_3;
if (temp_v0_3 < 0xA) {
phi_f20 = temp_f22;
} else {
block_14:
phi_v0 = phi_s0->unk14;
phi_f20 = D_800ED044;
}
}
} else {
temp_v0_4 = phi_s0->unk14;
phi_v0 = temp_v0_4;
if (temp_v0_4 < 0xA) {
phi_f20 = D_800ED040;
} else {
phi_f20 = D_800ED04C;
}
}
if ((phi_v0 & 1) == 0) {
func_80076D70(temp_s1 + 0x18, ((random_int(0x1E) + 0x14) * phi_f20) / 50.0f, phi_s0->unk10);
}
}
temp_s0 = phi_s0 + 0x1C;
phi_s0 = temp_s0;
} while (temp_s0 != &D_801642D8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000EF20.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80164670;
extern s16 D_80164672;
extern s16 D_80164674;
extern s16 D_80164676;
extern s16 D_80164678;
extern s16 D_8016467A;
extern s16 D_8016467C;
extern s16 D_8016467E;
void func_8000F0E0(void) {
D_80164670 = 0;
D_80164678 = 0;
D_80164672 = 0;
D_8016467A = 0;
D_80164674 = 0;
D_8016467C = 0;
D_80164676 = 0;
D_8016467E = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000F0E0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern u16 D_80163348;
extern ? D_8016334C;
void func_8000F124(void) {
s32 temp_a0;
s32 temp_a3;
s32 temp_s0;
s8 *temp_v0_2;
s8 temp_a2;
u16 *temp_v0;
u16 temp_v1;
void *temp_v0_3;
u16 *phi_v0;
u16 *phi_s1;
s8 *phi_v0_2;
s32 phi_s0;
u16 *phi_v0_3;
s32 phi_a0;
void *phi_v0_4;
s32 phi_a1;
s32 phi_a0_2;
s32 phi_a1_2;
s32 phi_a1_3;
s32 phi_a1_4;
s32 phi_a1_5;
phi_v0 = &D_80163348;
do {
temp_v0 = phi_v0 + 2;
temp_v0->unk-2 = 0;
phi_v0 = temp_v0;
} while (temp_v0 != &D_8016334C);
if (D_800DC51C != 1) {
phi_s1 = &D_80163348;
phi_s0 = 0;
if (gModeSelection == GRAND_PRIX) {
do {
loop_5:
temp_a2 = D_8018EDF3;
*phi_s1 = random_int(8);
phi_a1_2 = 0;
phi_a1_5 = 0;
if (temp_a2 < THREE_PLAYERS_SELECTED) {
phi_v0_2 = gCharacterSelections;
if (temp_a2 > ZERO_PLAYERS_SELECTED) {
if (temp_a2 > ZERO_PLAYERS_SELECTED) {
do {
temp_v0_2 = phi_v0_2 + 1;
phi_v0_2 = temp_v0_2;
if (*phi_v0_2 == *phi_s1) {
phi_a1_5 = 1;
}
phi_a1_2 = phi_a1_5;
} while (temp_v0_2 < &gCharacterSelections[temp_a2]);
}
temp_a3 = phi_s0 & 3;
phi_a0 = 0;
phi_a1 = phi_a1_2;
phi_a0_2 = 0;
phi_a1_3 = phi_a1_2;
phi_a1_4 = phi_a1_2;
if (phi_s0 > 0) {
temp_v1 = *phi_s1;
if (temp_a3 != 0) {
phi_v0_3 = (0 * 2) + &D_80163348;
do {
temp_a0 = phi_a0 + 1;
phi_a0 = temp_a0;
phi_a0_2 = temp_a0;
if (*phi_v0_3 == temp_v1) {
phi_a1_3 = 1;
}
phi_v0_3 += 2;
phi_a1 = phi_a1_3;
phi_a1_4 = phi_a1_3;
} while (temp_a3 != temp_a0);
if (temp_a0 != phi_s0) {
goto block_20;
}
} else {
block_20:
phi_v0_4 = (phi_a0_2 * 2) + &D_80163348;
do {
if (phi_v0_4->unk0 == temp_v1) {
phi_a1_4 = 1;
}
if (phi_v0_4->unk2 == temp_v1) {
phi_a1_4 = 1;
}
if (phi_v0_4->unk4 == temp_v1) {
phi_a1_4 = 1;
}
temp_v0_3 = phi_v0_4 + 8;
phi_v0_4 = temp_v0_3;
if (phi_v0_4->unk6 == temp_v1) {
phi_a1_4 = 1;
}
phi_a1 = phi_a1_4;
} while (temp_v0_3 != ((phi_s0 * 2) + &D_80163348));
}
}
if (phi_a1 != 0) {
goto loop_5;
}
}
}
temp_s0 = phi_s0 + 1;
phi_s1 += 2;
phi_s0 = temp_s0;
} while (temp_s0 != 2);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000F124.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_8000F2BC(void *arg0, s32 arg1) {
bzero(arg0, arg1 * 8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000F2BC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000DD78(); // extern
? func_8000F2BC(s16 *, s32); // extern
? func_800100F0(s32); // extern
? func_80010218(s32); // extern
? func_800107C4(s32); // extern
? func_80010DBC(s32); // extern
? func_80010E6C(s32); // extern
? func_800120C8(); // extern
? func_80012190(); // extern
? func_800127E0(); // extern
? func_800132F4(); // extern
? func_800147E0(); // extern
? func_80014934(); // extern
? func_80014A88(); // extern
? func_80014BDC(); // extern
extern ? D_800DD9D0;
extern s32 D_801631D0;
extern s32 D_801631D4;
extern s32 D_801631D8;
extern s32 D_801631DC;
extern s32 D_80163368;
extern s32 D_80163598;
extern u16 D_80164430;
extern s16 *D_80164490;
extern s32 D_80164560;
extern s32 D_80164570;
extern s32 D_80164580;
extern s32 D_80164590;
extern s32 D_801645A0;
extern ? D_801645B0;
extern u16 D_801645C8;
extern s32 D_801645E0;
void func_8000F2DC(void) {
s16 temp_v0_2;
s32 *temp_s2;
s32 temp_s0;
s32 temp_s0_2;
u32 temp_s5;
void *temp_v0;
s32 *phi_s1;
s16 **phi_s3;
s32 *phi_s4;
s32 *phi_s2;
s32 *phi_s6;
s32 *phi_s7;
s32 *phi_s5;
s16 **phi_s3_2;
s32 *phi_s1_2;
s32 *phi_s4_2;
s32 *phi_s2_2;
s32 phi_s0;
s32 *phi_s1_3;
s32 phi_s0_2;
temp_v0 = (gCurrentCourseId * 0x10) + &D_800DD9D0;
D_80163368.unk0 = temp_v0->unk0;
D_80163368.unk4 = temp_v0->unk2;
D_80163368.unk8 = temp_v0->unk4;
D_80163368.unkC = temp_v0->unk6;
D_80163598 = func_802A7B70(temp_v0->unk8 * 4);
phi_s1 = &D_80163368;
phi_s3 = &D_80164550;
phi_s4 = &D_80164560;
phi_s2 = &D_80164570;
phi_s6 = &D_80164580;
phi_s7 = &D_80164590;
phi_s5 = &D_801645A0;
do {
*phi_s3 = func_802A7B70(*phi_s1 * 8);
*phi_s4 = func_802A7B70(*phi_s1 * 8);
*phi_s2 = func_802A7B70(*phi_s1 * 8);
*phi_s6 = func_802A7B70(*phi_s1 * 2);
*phi_s7 = func_802A7B70(*phi_s1 * 2);
temp_s5 = phi_s5 + 4;
temp_s5->unk-4 = func_802A7B70(*phi_s1 * 2);
phi_s1 += 4;
phi_s3 += 4;
phi_s4 += 4;
phi_s2 += 4;
phi_s6 += 4;
phi_s7 += 4;
phi_s5 = temp_s5;
} while (temp_s5 < &D_801645B0);
D_80164490 = D_80164550;
D_801631D0 = D_80164560;
D_801631D4 = D_80164570;
D_801631D8 = D_80164580;
D_801631DC = D_80164590;
D_801645E0 = D_801645A0;
phi_s3_2 = &D_80164550;
phi_s1_2 = &D_80163368;
phi_s4_2 = &D_80164560;
phi_s2_2 = &D_80164570;
do {
func_8000F2BC(*phi_s3_2, *phi_s1_2);
func_8000F2BC(*phi_s4_2, *phi_s1_2);
func_8000F2BC(*phi_s2_2, *phi_s1_2);
temp_s2 = phi_s2_2 + 4;
phi_s3_2 += 4;
phi_s1_2 += 4;
phi_s4_2 += 4;
phi_s2_2 = temp_s2;
} while (temp_s2 < &D_80164580);
phi_s0 = 0;
phi_s0_2 = 0;
do {
temp_s0 = phi_s0 + 1;
phi_s0 = temp_s0;
} while (temp_s0 < 4);
phi_s1_3 = &D_80163368;
do {
if (*phi_s1_3 >= 2) {
func_800100F0(phi_s0_2);
func_80010218(phi_s0_2);
func_800107C4(phi_s0_2);
func_80010DBC(phi_s0_2);
func_80010E6C(phi_s0_2);
}
temp_s0_2 = phi_s0_2 + 1;
phi_s1_3 += 4;
phi_s0_2 = temp_s0_2;
} while (temp_s0_2 != 4);
temp_v0_2 = gCurrentCourseId;
D_80164430 = D_801645C8;
if (temp_v0_2 != 0xA) {
if (temp_v0_2 != 0xB) {
if (temp_v0_2 != 0x12) {
} else {
func_80012190();
func_800132F4();
}
} else {
func_800120C8();
func_800127E0();
}
} else {
func_800147E0();
func_80014934();
func_80014A88();
func_80014BDC();
}
func_8000DD78();
func_8000EEDC();
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000F2DC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000B95C(s32, ?, ?, s16 *); // extern
? func_80011A5C(); // extern
? func_80011AB8(s32, s32); // extern
? func_8001AB00(? *, s16, s16 *, s16); // extern
void *segmented_to_virtual_dupe(void*); // extern
extern ? D_0D009418;
extern ? D_800DCAA0;
extern f32 D_800ED050;
extern f32 gTimePlayerLastTouchedFinishLine;
extern ? D_80162F10;
extern ? D_80162F50;
extern ? D_80162F8C;
extern s16 D_80162FF8;
extern s16 D_80163010;
extern f32 D_80163028;
extern s16 D_80163050;
extern f32 D_80163068;
extern f32 D_80163090;
extern ? D_801630B8;
extern s16 D_801630E8;
extern s32 D_80163100;
extern s32 D_80163128;
extern s32 D_80163150;
extern f32 D_80163178;
extern f32 D_801631A0;
extern s32 D_801631CC;
extern s16 D_801631E0;
extern s16 D_801631F8;
extern f32 D_80163210;
extern s16 D_80163258;
extern s16 D_80163270;
extern s32 D_80163288;
extern s16 D_80163318;
extern s16 D_80163330;
extern ? D_80163340;
extern s16 D_80163344;
extern ? D_80163346;
extern u16 D_80163348;
extern ? D_8016334C;
extern s16 D_80163350;
extern s32 D_80163378;
extern s32 D_8016337C;
extern s16 D_80163380;
extern s16 D_80163398;
extern s16 D_801633B0;
extern s16 D_801633C8;
extern s16 D_801633F8;
extern f32 D_8016344C;
extern f32 D_80163450;
extern s16 D_80163478;
extern s16 D_8016347A;
extern s32 D_80163488;
extern s16 D_8016348C;
extern s16 D_80163490;
extern s16 D_801634A8;
extern ? D_801634C0;
extern ? D_801634D8;
extern s16 D_801634EC;
extern s32 D_801634F0;
extern s32 D_801634F4;
extern ? D_801634F8;
extern ? D_801637BC;
extern s16 D_80164358;
extern s16 D_8016435A;
extern s16 D_8016435C;
extern ? D_80164360;
extern ? D_80164378;
extern s32 D_801643E0;
extern s32 D_80164408;
extern ? D_80164438;
extern ? D_80164448;
extern s32 D_80164450;
extern ? D_80164478;
extern f32 gCourseCompletionPercentByPlayerId;
extern s16 D_801644F8;
extern ? D_80164538;
extern ? D_801645B0;
extern ? D_801645C8;
extern f32 D_80164698;
extern f32 D_8016469C;
extern f32 D_801646A0;
extern s16 D_8016479E;
extern ? D_801647A8;
extern s8 D_8018EE08;
extern ? gPlayers;
extern s32 gLapCountByPlayerId;
void func_8000F628(void) {
void *sp104;
s16 *spF8;
s16 *spF4;
s16 *spF0;
f32 *spE8;
s16 *spE4;
s32 *spE0;
f32 *spDC;
f32 *spD8;
f32 *spD4;
s32 *spD0;
f32 *spCC;
f32 *spC8;
s32 *spBC;
s16 *spB8;
s16 *spB4;
s16 *spB0;
s16 *spAC;
s32 *spA8;
s32 *spA4;
f32 *sp9C;
f32 *sp98;
s16 *sp90;
s16 *sp8C;
s16 *sp88;
s16 *sp84;
s16 *sp80;
s16 *sp7C;
s16 *sp78;
f32 *sp74;
s16 *sp70;
s16 *sp68;
s16 *sp64;
s32 *sp60;
s32 *sp5C;
? *sp58;
? *sp54;
? *sp50;
? *sp4C;
? *temp_a0;
? *temp_a1;
? *temp_a2;
? *temp_s1;
? *temp_v0_5;
? *temp_v0_6;
? *temp_v1_2;
? *temp_v1_4;
f32 temp_f0;
s16 *temp_v0_4;
s16 temp_s0;
s16 temp_s0_2;
s16 temp_t6;
s16 temp_t6_2;
s16 temp_t9;
s16 temp_v0;
s16 temp_v0_2;
s32 temp_s0_3;
s32 temp_s3;
s32 temp_t7;
s32 temp_t8;
s32 temp_t8_2;
s32 temp_v0_3;
s32 temp_v1;
u32 temp_s2;
u32 temp_v0_7;
u32 temp_v1_3;
void *temp_s1_2;
void *temp_s1_3;
void *temp_s1_4;
void *temp_s1_5;
s16 *phi_a3;
s16 *phi_t0;
s16 *phi_t1;
s32 phi_s7;
f32 *phi_ra;
f32 *phi_t2;
s16 *phi_t3;
s32 *phi_t4;
f32 *phi_t5;
s32 phi_s0;
s16 phi_v0;
s32 phi_fp;
s32 *phi_s4;
s32 *phi_s6;
? *phi_s1;
? *phi_s5;
s16 *phi_s2;
u16 *phi_a0;
s16 phi_s0_2;
s16 *phi_v0_2;
s16 *phi_s2_2;
? *phi_a0_2;
s16 phi_s0_3;
? *phi_v0_3;
? *phi_v0_4;
s32 *phi_s4_2;
? *phi_v1;
? *phi_v1_2;
? *phi_v0_5;
s16 phi_s1_2;
s16 *phi_s2_3;
s32 phi_s0_4;
s16 phi_s1_3;
s16 phi_s1_4;
s16 phi_s1_5;
spD4 = &D_80163210;
spD0 = &gLapCountByPlayerId;
spB8 = &D_80163258;
spBC = &D_80164408;
spCC = &gCourseCompletionPercentByPlayerId;
spC8 = &gTimePlayerLastTouchedFinishLine;
spB0 = &D_801631E0;
spB4 = &D_80163270;
spAC = &D_801631F8;
spA8 = &D_80164450;
sp90 = &D_80163350;
sp98 = &D_80163090;
spA4 = &D_80163288;
sp9C = &D_80163068;
sp88 = &D_80163398;
sp8C = &D_801644F8;
sp84 = &D_801633B0;
sp80 = &D_801633C8;
sp70 = &D_80163380;
sp74 = &D_80163450;
sp7C = &D_801633F8;
sp78 = &D_80163318;
sp64 = &D_801634A8;
sp68 = &D_80163490;
sp60 = &D_80163128;
sp5C = &D_80163150;
sp4C = &D_801630B8;
sp50 = &D_801634D8;
sp58 = &D_80164538;
sp54 = &D_801634C0;
phi_a3 = &D_80163050;
phi_t0 = &D_80162FF8;
phi_t1 = &D_80163010;
phi_s7 = 0;
phi_ra = &D_801631A0;
phi_t2 = &D_80163028;
phi_t3 = &D_801630E8;
phi_t4 = &D_80163100;
phi_t5 = &D_80163178;
phi_s0 = 0;
phi_fp = 0;
phi_s4 = gPlayerPositions;
phi_s6 = &D_801643E0;
phi_s1 = &gPlayers;
phi_s5 = &D_801634F8;
phi_s2 = &D_80163330;
phi_s0_2 = 0;
phi_s0_4 = 0;
do {
*phi_a3 = 0;
*phi_t0 = 0;
*phi_t1 = 0;
temp_v0 = gCurrentCourseId;
sp104 = phi_s7 + gPlayerOne;
phi_v0 = temp_v0;
if (temp_v0 < 0x14) {
spD8 = phi_ra;
spF8 = phi_a3;
spF4 = phi_t0;
spF0 = phi_t1;
spE8 = phi_t2;
spE4 = phi_t3;
spE0 = phi_t4;
spDC = phi_t5;
func_8000B95C(phi_s0, 0, 0, phi_a3);
phi_v0 = gCurrentCourseId;
}
spD8 = phi_ra;
spF8 = phi_a3;
spF4 = phi_t0;
spF0 = phi_t1;
spE8 = phi_t2;
spE4 = phi_t3;
spE0 = phi_t4;
spDC = phi_t5;
*phi_t2 = *segmented_to_virtual_dupe((phi_v0 * 0x10) + (gCCSelection * 4) + &D_0D009418);
*phi_t3 = 0;
*phi_t4 = 0;
*phi_t5 = 0.0f;
*phi_ra = 0.0f;
*spD4 = 0.0f;
*spD0 = -1;
*spCC = 0.0f;
*spC8 = 0.0f;
if (gModeSelection == GRAND_PRIX) {
temp_v0_2 = *(phi_fp + D_80165270);
*phi_s4 = temp_v0_2;
*phi_s6 = temp_v0_2;
} else {
*phi_s4 = phi_s0;
*phi_s6 = phi_s0;
}
temp_v0_3 = *phi_s4;
temp_v1 = temp_v0_3 * 2;
*(&D_80164360 + temp_v1) = phi_s0;
*(&D_80164378 + temp_v1) = phi_s0;
*spBC = temp_v0_3;
*spB8 = 0;
temp_s3 = phi_s0 + 1;
*spB4 = 0;
*spB0 = 0;
*spAC = 0;
*spA8 = -0x14;
*spA4 = -0x14;
*(&D_80164478 + (phi_s1->unk254 * 2)) = phi_s0;
*sp9C = 0.0f;
*sp98 = 0.0f;
spD8 = phi_ra;
spDC = phi_t5;
phi_s5->unk0 = 0.0f;
spE0 = phi_t4;
spE4 = phi_t3;
spE8 = phi_t2;
spF0 = phi_t1;
spF4 = phi_t0;
temp_f0 = *(&D_800DCAA0 + (gCurrentCourseId * 4)) * ((temp_s3 % 3) - 1);
spF8 = phi_a3;
phi_s5->unkC = temp_f0;
phi_s5->unk4 = temp_f0;
phi_s5->unk8 = D_800ED050;
func_80011AB8(phi_s0, -0x14);
*sp90 = 0;
*sp8C = 0;
*sp88 = 0;
*sp84 = 0;
temp_s1 = phi_s1 + 0xDD8;
*sp80 = 0;
*sp7C = 0;
*sp78 = 0;
*sp74 = sp104->unk1C;
*sp70 = 6;
phi_a3 += 2;
phi_t0 += 2;
phi_t1 += 2;
phi_s7 += 0xDD8;
phi_ra += 4;
phi_t2 += 4;
phi_t3 += 2;
phi_t4 += 4;
phi_t5 += 4;
phi_s0 = temp_s3;
phi_fp += 2;
phi_s4 += 4;
phi_s6 += 4;
phi_s1 = temp_s1;
phi_s5 += 0x10;
if ((temp_s1->unk-DD8 & 0x4000) != 0) {
*phi_s2 = 3;
} else {
*phi_s2 = 0;
}
*sp68 = 0;
temp_v1_2 = sp4C + 4;
*sp64 = 0;
temp_a0 = sp50 + 2;
temp_a1 = sp54 + 2;
*sp60 = -1;
temp_a2 = sp58 + 2;
*sp5C = -1;
temp_v1_2->unk-4 = 1;
spD4 += 4;
spD0 += 4;
spC8 += 4;
spCC += 4;
spBC += 4;
spB8 += 2;
spB0 += 2;
spB4 += 2;
spAC += 2;
spA8 += 4;
sp9C += 4;
spA4 += 4;
sp98 += 4;
sp90 += 2;
sp88 += 2;
sp8C += 2;
sp84 += 2;
sp80 += 2;
sp78 += 2;
sp7C += 2;
sp74 += 4;
sp70 += 2;
sp64 += 2;
sp68 += 2;
sp60 += 4;
sp5C += 4;
sp58 = temp_a2;
sp54 = temp_a1;
sp50 = temp_a0;
sp4C = temp_v1_2;
temp_a0->unk-2 = 0;
temp_a1->unk-2 = 0;
temp_a2->unk-2 = -1;
phi_s2 += 2;
} while (temp_s3 < 8);
D_801637BC.unk0 = 0;
D_801637BC.unk2 = 0;
if (D_800DC51C == 0) {
phi_v0_2 = &D_80163344;
if (gModeSelection == GRAND_PRIX) {
phi_a0 = &D_80163348;
do {
temp_v0_4 = phi_v0_2 + 2;
temp_t9 = *(&D_80164478 + (*phi_a0 * 2));
temp_t7 = (temp_t9 & 0xFFFF) * 2;
*(&D_80163330 + temp_t7) = 1;
*(&D_8016334C + temp_t7) = phi_s0_2;
temp_s0 = phi_s0_2 + 1;
temp_v0_4->unk-2 = temp_t9;
phi_a0 += 2;
phi_s0_2 = temp_s0;
phi_v0_2 = temp_v0_4;
} while (temp_s0 != 2);
}
}
phi_s1_2 = 1;
phi_s1_3 = 1;
phi_s1_4 = 1;
phi_s1_5 = 1;
phi_s1_2 = 1;
if ((D_8018EE08 == 1) && (gCurrentCourseId != 0x14)) {
phi_s2_2 = &D_80163330;
do {
temp_s2 = phi_s2_2 + 2;
temp_s2->unk-2 = 0;
phi_s2_2 = temp_s2;
} while (temp_s2 < &D_80163340);
if (gModeSelection == VERSUS) {
temp_t6 = D_8016479E;
temp_t8 = (temp_t6 & 0xFFFF) * 2;
*(&D_80163330 + temp_t8) = 1;
*(&D_8016334C + temp_t8) = 0;
D_80163344 = temp_t6;
phi_a0_2 = &D_801647A8;
phi_s0_3 = 1;
phi_v0_3 = &D_80163346;
do {
temp_t6_2 = phi_a0_2->unkAE;
temp_v0_5 = phi_v0_3 + 2;
temp_t8_2 = (temp_t6_2 & 0xFFFF) * 2;
*(&D_80163330 + temp_t8_2) = 1;
*(&D_8016334C + temp_t8_2) = phi_s0_3;
temp_s0_2 = phi_s0_3 + 1;
temp_v0_5->unk-2 = temp_t6_2;
phi_a0_2 += 0xB8;
phi_s0_3 = temp_s0_2;
phi_v0_3 = temp_v0_5;
} while (temp_s0_2 != 2);
}
}
phi_v0_4 = &D_801645B0;
phi_s4_2 = gPlayerPositions;
phi_v1 = &D_80164438;
do {
temp_v1_3 = phi_v1 + 2;
temp_v0_6 = phi_v0_4 + 2;
temp_v0_6->unk-2 = 0;
temp_v1_3->unk-2 = (*(&D_801645C8 + ((0 & 0xFFFF) * 2)) - *phi_s4_2) - 4;
phi_v0_4 = temp_v0_6;
phi_s4_2 += 4;
phi_v1 = temp_v1_3;
} while (temp_v1_3 < &D_80164448);
D_8016347A = 0;
phi_v1_2 = &D_80162F10;
if (gCCSelection == CC_EXTRA) {
D_8016347A = 1;
}
phi_v0_5 = &D_80162F50;
do {
temp_v0_7 = phi_v0_5 + 2;
temp_v1_4 = phi_v1_2 + 2;
temp_v1_4->unk-2 = -1;
temp_v0_7->unk-2 = -1;
phi_v1_2 = temp_v1_4;
phi_v0_5 = temp_v0_7;
} while (temp_v0_7 < &D_80162F8C);
D_801631CC = 0x186A0;
D_80164698 = 0.0f;
D_8016469C = 100.0f;
D_801646A0 = 0.0f;
D_80164358 = 0;
D_8016435A = 1;
D_8016435C = 1;
D_80163478 = 0;
D_80163378 = 0;
D_8016337C = 0;
D_8016344C = D_80164550->unk4;
D_801634F0 = 0;
D_801634F4 = 0;
D_80163488 = 0;
D_8016348C = 0;
D_801634EC = 0;
func_8001AB00(&D_80162F8C, -1, &D_80163330, 1);
if (D_8018EE08 == 1) {
phi_s2_3 = &D_80163330;
if (D_800DC51C == 1) {
do {
phi_s1_3 = phi_s1_2;
if (phi_s1_2 == phi_s2_3->unk0) {
temp_s1_2 = &gPlayers + (phi_s0_4 * 0xDD8);
temp_s1_2->unkC = temp_s1_2->unkC | 0x2000000;
}
phi_s1_4 = phi_s1_3;
if (phi_s1_3 == phi_s2_3->unk2) {
temp_s1_3 = &gPlayers + (phi_s0_4 * 0xDD8);
temp_s1_3->unkDE4 = temp_s1_3->unkDE4 | 0x2000000;
}
phi_s1_5 = phi_s1_4;
if (phi_s1_4 == phi_s2_3->unk4) {
temp_s1_4 = &gPlayers + (phi_s0_4 * 0xDD8);
temp_s1_4->unk1BBC = temp_s1_4->unk1BBC | 0x2000000;
}
phi_s1_2 = phi_s1_5;
if (phi_s1_5 == phi_s2_3->unk6) {
temp_s1_5 = &gPlayers + (phi_s0_4 * 0xDD8);
temp_s1_5->unk2994 = temp_s1_5->unk2994 | 0x2000000;
}
temp_s0_3 = phi_s0_4 + 4;
phi_s2_3 += 8;
phi_s0_4 = temp_s0_3;
} while (temp_s0_3 != 8);
}
}
func_80011A5C();
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000F628.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_80011014(s16 *, u16 *, s32, s32); // extern
s16 process_path_data(s16 *, u16 *); // extern
void *segmented_to_virtual_dupe(void*); // extern
extern ? D_800DC8D0;
extern ? D_800DCA4C;
extern ? D_801645C8;
extern ? gCoursePathTable;
void func_800100F0(s32 arg0) {
s16 *sp30;
u16 *sp2C;
s32 sp24;
s16 sp1A;
s16 temp_v0;
s32 temp_t9;
s32 temp_v1;
u16 *temp_v0_2;
u16 *phi_a0;
s32 phi_v1;
s16 phi_a2;
s16 phi_v0;
s16 *phi_at;
temp_v0 = gCurrentCourseId;
temp_t9 = arg0 * 4;
phi_a2 = 1;
if (*(&D_800DCA4C + (temp_v0 * 4)) >= 0) {
sp30 = (&D_80164550)[arg0];
if (temp_v0 != 0x14) {
phi_v0 = process_path_data(sp30, segmented_to_virtual_dupe(*(&D_800DC8D0 + ((temp_v0 * 0x10) + temp_t9))));
phi_at = &D_801645C8 + (arg0 * 2);
goto block_9;
}
sp1A = 1;
temp_v0_2 = segmented_to_virtual_dupe(*(&gCoursePathTable + ((temp_v0 * 0x10) + temp_t9)));
sp2C = temp_v0_2;
phi_a0 = temp_v0_2;
phi_v1 = 0;
loop_4:
if (*phi_a0 == 0x8000) {
sp24 = phi_v1 - 1;
phi_a2 = 0;
} else {
temp_v1 = phi_v1 + 1;
phi_a0 += 8;
phi_v1 = temp_v1;
if (temp_v1 != 0xBB8) {
goto loop_4;
}
}
if (phi_a2 == 0) {
phi_v0 = func_80011014(sp30, sp2C, sp24, arg0);
phi_at = &D_801645C8 + (arg0 * 2);
block_9:
*phi_at = phi_v0;
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800100F0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_800DCA4C;
extern ? D_80164560;
extern ? D_80164570;
extern ? D_801645C8;
void func_80010218(s32 arg0) {
f32 sp74;
f32 sp68;
f32 sp64;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f10;
f32 temp_f20;
f32 temp_f22;
f32 temp_f24;
f32 temp_f26;
f32 temp_f28;
f32 temp_f2;
f32 temp_f30;
s16 **temp_s4;
s16 *temp_s0;
s32 temp_f16;
s32 temp_s3;
s32 temp_v0;
u16 *temp_s5;
void *temp_s1;
void *temp_s2;
void *temp_v0_2;
s16 *phi_s0;
s32 phi_a0;
void *phi_s1;
void *phi_s2;
temp_f0 = *(&D_800DCA4C + (gCurrentCourseId * 4));
if (temp_f0 >= 0) {
temp_v0 = arg0 * 4;
temp_s5 = (arg0 * 2) + &D_801645C8;
temp_s4 = &(&D_80164550)[arg0];
temp_f24 = temp_f0;
phi_s0 = *temp_s4;
phi_a0 = 0;
phi_s1 = *(&D_80164560 + temp_v0);
phi_s2 = *(&D_80164570 + temp_v0);
if (*temp_s5 > 0) {
do {
temp_s3 = phi_a0 + 1;
temp_f10 = phi_s0->unk2;
temp_v0_2 = ((temp_s3 % *temp_s5) * 8) + *temp_s4;
temp_s0 = phi_s0 + 8;
temp_f20 = phi_s0->unk0;
sp74 = temp_f10;
temp_f30 = temp_v0_2->unk0;
sp68 = temp_v0_2->unk2;
temp_f22 = temp_s0->unk-4;
temp_f2 = temp_v0_2->unk4;
temp_f26 = temp_f30 - temp_f20;
sp64 = temp_f2;
temp_f28 = temp_f2 - temp_f22;
temp_f0_2 = sqrtf((temp_f26 * temp_f26) + (temp_f28 * temp_f28));
temp_s1 = phi_s1 + 8;
temp_s2 = phi_s2 + 8;
temp_s1->unk-8 = ((temp_f24 * temp_f28) / temp_f0_2) + temp_f20;
temp_f16 = (temp_f10 + sp68) * 0.5;
temp_s1->unk-6 = temp_f16;
temp_s1->unk-4 = ((temp_f24 * (temp_f20 - temp_f30)) / temp_f0_2) + temp_f22;
temp_s2->unk-6 = temp_f16;
temp_s2->unk-8 = ((temp_f24 * (temp_f22 - temp_f2)) / temp_f0_2) + temp_f20;
temp_s2->unk-4 = ((temp_f24 * temp_f26) / temp_f0_2) + temp_f22;
phi_s0 = temp_s0;
phi_a0 = temp_s3;
phi_s1 = temp_s1;
phi_s2 = temp_s2;
} while (temp_s3 < *temp_s5);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010218.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_800DCA4C;
extern ? D_801645C8;
f32 func_80010480(s32 arg0, u16 arg1) {
f32 sp54;
f32 sp50;
f32 sp4C;
f32 sp48;
f32 sp44;
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp20;
f32 sp1C;
f32 sp18;
f32 temp_f10;
f32 temp_f10_2;
f32 temp_f14;
f32 temp_f16;
f32 temp_f18;
f32 temp_f8;
f32 temp_f8_2;
s16 *temp_v0;
u16 temp_v1;
void *temp_a1;
void *temp_a1_2;
void *temp_a2;
void *temp_a2_2;
void *temp_a3;
void *temp_a3_2;
if (*(&D_800DCA4C + (gCurrentCourseId * 4)) < 0) {
return 0.0f;
}
temp_v1 = *(&D_801645C8 + (arg0 * 2));
temp_v0 = (&D_80164550)[arg0];
temp_a2 = (arg1 * 8) + temp_v0;
temp_a3 = (((arg1 + 1) % temp_v1) * 8) + temp_v0;
temp_a1 = (((arg1 + 2) % temp_v1) * 8) + temp_v0;
temp_a1_2 = (((arg1 + 3) % temp_v1) * 8) + temp_v0;
temp_a2_2 = (((arg1 + 4) % temp_v1) * 8) + temp_v0;
sp40 = temp_a1->unk4;
temp_f8_2 = ((temp_a3->unk0 + temp_a1->unk0) * 0.5) - temp_a2->unk0;
sp3C = temp_f8_2;
temp_f10 = ((temp_a3->unk4 + sp40) * 0.5) - temp_a2->unk4;
sp38 = temp_f10;
temp_f14 = temp_a1_2->unk0;
temp_f16 = temp_a1_2->unk4;
temp_a3_2 = (((arg1 + 5) % temp_v1) * 8) + temp_v0;
temp_f18 = temp_a2_2->unk0;
sp48 = temp_a2_2->unk4;
sp44 = temp_a3_2->unk0;
sp4C = temp_f18;
sp50 = temp_f16;
sp54 = temp_f14;
sp40 = temp_a3_2->unk4;
sp20 = sqrtf((sp38 * sp38) + (temp_f8_2 * temp_f8_2));
temp_f10_2 = ((temp_f18 + sp44) * 0.5) - temp_f14;
sp1C = temp_f10_2;
temp_f8 = ((sp48 + sp40) * 0.5) - temp_f16;
sp18 = temp_f8;
return -((temp_f10 * sp1C) - (sp3C * sp18)) / (sqrtf((temp_f10_2 * temp_f10_2) + (temp_f8 * temp_f8)) * sp20);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010480.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 func_80010480(s32, s32); // extern
extern ? D_800DCA4C;
extern f64 D_800ED058;
extern f64 D_800ED060;
extern ? D_80164580;
extern ? D_801645C8;
void func_800107C4(s32 arg0) {
s16 *sp54;
s32 sp50;
s16 **sp3C;
f64 temp_f20;
f64 temp_f22;
f64 temp_f2;
s16 **temp_t0;
s16 *temp_t4;
s16 temp_v0;
s32 temp_a0;
s32 temp_a0_2;
s32 temp_a2;
s32 temp_a2_2;
s32 temp_a2_3;
s32 temp_a2_4;
s32 temp_s0;
s32 temp_s0_2;
s32 temp_t2;
s32 temp_v0_2;
s32 temp_v0_3;
u16 temp_a3;
s32 phi_a3;
s16 **phi_t0;
s16 *phi_t4;
s32 phi_s0;
s32 phi_a3_2;
s16 *phi_t4_2;
s16 **phi_t0_2;
s32 phi_s0_2;
s32 phi_t2;
s32 phi_v0;
s32 phi_a2;
s32 phi_v0_2;
s32 phi_v1;
s32 phi_a0;
s32 phi_a1;
s32 phi_a2_2;
s32 phi_v0_3;
s32 phi_a2_3;
s32 phi_v0_4;
s32 phi_v1_2;
s32 phi_a0_2;
s32 phi_a1_2;
s32 phi_a2_4;
s32 phi_t2_2;
s32 phi_s0_3;
s16 *phi_t4_3;
s32 phi_s0_4;
s32 phi_s0_5;
s32 phi_a2_5;
s32 phi_a2_6;
s16 *phi_t4_4;
s16 *phi_t4_5;
if (*(&D_800DCA4C + (gCurrentCourseId * 4)) >= 0) {
temp_a3 = *(&D_801645C8 + (arg0 * 2));
temp_t0 = (arg0 * 4) + &D_80164580;
temp_t4 = *temp_t0;
phi_a3 = temp_a3;
phi_t0 = temp_t0;
phi_t4 = temp_t4;
phi_s0 = 0;
phi_a3_2 = temp_a3;
phi_t0_2 = temp_t0;
phi_t4_2 = temp_t4;
if (temp_a3 > 0) {
temp_f22 = D_800ED058;
temp_f20 = D_800ED060;
do {
sp50 = phi_a3;
sp3C = phi_t0;
sp54 = phi_t4;
temp_f2 = func_80010480(arg0, phi_s0 & 0xFFFF);
temp_s0 = phi_s0 + 1;
*phi_t4 = 4;
phi_s0 = temp_s0;
phi_a3_2 = phi_a3;
phi_t0_2 = phi_t0;
if (temp_f20 < temp_f2) {
*phi_t4 = 2;
}
if (temp_f2 < temp_f22) {
*phi_t4 = 3;
}
phi_t4 += 2;
} while (temp_s0 != phi_a3);
phi_t4_2 = *phi_t0;
}
phi_s0_4 = 0;
if (phi_a3_2 > 0) {
do {
phi_s0_2 = phi_s0_4;
phi_s0_3 = phi_s0_4;
phi_t4_3 = phi_t4_2;
phi_t4_5 = phi_t4_2;
if (*phi_t4_2 == 4) {
phi_t2 = 1;
if (phi_a3_2 >= 2) {
do {
temp_v0 = *(*phi_t0_2 + (((phi_s0_2 + phi_t2) % phi_a3_2) * 2));
phi_t2_2 = phi_t2;
phi_s0_5 = phi_s0_2;
phi_t4_4 = phi_t4_5;
if (temp_v0 != 0) {
if (temp_v0 != 1) {
if (temp_v0 != 2) {
if (temp_v0 != 3) {
} else {
goto block_26;
}
} else {
goto block_18;
}
} else {
block_26:
phi_a2 = 0;
phi_a2_5 = 0;
if (phi_t2 > 0) {
temp_a0 = phi_t2 & 3;
if (temp_a0 != 0) {
phi_v0 = phi_s0_2;
do {
temp_a2 = phi_a2 + 1;
*(*phi_t0_2 + ((phi_v0 % phi_a3_2) * 2)) = 1;
phi_v0 += 1;
phi_a2 = temp_a2;
phi_a2_5 = temp_a2;
} while (temp_a0 != temp_a2);
if (temp_a2 != phi_t2) {
goto block_31;
}
} else {
block_31:
temp_v0_2 = phi_s0_2 + phi_a2_5;
phi_v0_2 = temp_v0_2;
phi_v1 = temp_v0_2 + 1;
phi_a0 = temp_v0_2 + 2;
phi_a1 = temp_v0_2 + 3;
phi_a2_2 = phi_a2_5;
do {
*(*phi_t0_2 + ((phi_v0_2 % phi_a3_2) * 2)) = 1;
*(*phi_t0_2 + ((phi_v1 % phi_a3_2) * 2)) = 1;
*(*phi_t0_2 + ((phi_a0 % phi_a3_2) * 2)) = 1;
temp_a2_2 = phi_a2_2 + 4;
*(*phi_t0_2 + ((phi_a1 % phi_a3_2) * 2)) = 1;
phi_v0_2 += 4;
phi_v1 += 4;
phi_a0 += 4;
phi_a1 += 4;
phi_a2_2 = temp_a2_2;
} while (temp_a2_2 != phi_t2);
}
}
phi_t4_4 = phi_t4_5 + (phi_t2 * 2);
goto block_34;
}
} else {
block_18:
phi_a2_3 = 0;
phi_a2_6 = 0;
if (phi_t2 > 0) {
temp_a0_2 = phi_t2 & 3;
if (temp_a0_2 != 0) {
phi_v0_3 = phi_s0_2;
do {
temp_a2_3 = phi_a2_3 + 1;
*(*phi_t0_2 + ((phi_v0_3 % phi_a3_2) * 2)) = 0;
phi_v0_3 += 1;
phi_a2_3 = temp_a2_3;
phi_a2_6 = temp_a2_3;
} while (temp_a0_2 != temp_a2_3);
if (temp_a2_3 != phi_t2) {
goto block_23;
}
} else {
block_23:
temp_v0_3 = phi_s0_2 + phi_a2_6;
phi_v0_4 = temp_v0_3;
phi_v1_2 = temp_v0_3 + 1;
phi_a0_2 = temp_v0_3 + 2;
phi_a1_2 = temp_v0_3 + 3;
phi_a2_4 = phi_a2_6;
do {
*(*phi_t0_2 + ((phi_v0_4 % phi_a3_2) * 2)) = 0;
*(*phi_t0_2 + ((phi_v1_2 % phi_a3_2) * 2)) = 0;
*(*phi_t0_2 + ((phi_a0_2 % phi_a3_2) * 2)) = 0;
temp_a2_4 = phi_a2_4 + 4;
*(*phi_t0_2 + ((phi_a1_2 % phi_a3_2) * 2)) = 0;
phi_v0_4 += 4;
phi_v1_2 += 4;
phi_a0_2 += 4;
phi_a1_2 += 4;
phi_a2_4 = temp_a2_4;
} while (temp_a2_4 != phi_t2);
}
}
phi_t4_4 = phi_t4_5 + (phi_t2 * 2);
block_34:
phi_t2_2 = phi_a3_2;
phi_s0_5 = phi_s0_2 + phi_t2;
}
temp_t2 = phi_t2_2 + 1;
phi_s0_2 = phi_s0_5;
phi_t2 = temp_t2;
phi_s0_3 = phi_s0_5;
phi_t4_3 = phi_t4_4;
phi_t4_5 = phi_t4_4;
} while (temp_t2 < phi_a3_2);
}
}
temp_s0_2 = phi_s0_3 + 1;
phi_t4_2 = phi_t4_3 + 2;
phi_s0_4 = temp_s0_2;
} while (temp_s0_2 < phi_a3_2);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800107C4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_802B5224(f32 *, f32 *, s32, s32); // extern
extern ? D_801645C8;
s16 func_80010CB0(s32 arg0, s32 arg1) {
f32 sp38;
f32 sp34;
f32 sp30;
f32 sp2C;
f32 sp28;
f32 sp24;
f32 *temp_a0;
f32 *temp_a1;
s16 *temp_v1;
void *temp_v0;
void *temp_v0_2;
temp_v1 = (&D_80164550)[arg0];
temp_v0 = temp_v1 + (arg1 * 8);
temp_a1 = &sp24;
temp_a0 = &sp30;
sp30 = temp_v0->unk0;
sp34 = temp_v0->unk2;
temp_v0_2 = (((arg1 + 1) % *(&D_801645C8 + (arg0 * 2))) * 8) + temp_v1;
sp38 = temp_v0->unk4;
sp24 = temp_v0_2->unk0;
sp28 = temp_v0_2->unk2;
sp2C = temp_v0_2->unk4;
return func_802B5224(temp_a0, temp_a1, arg0, arg1) * -1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010CB0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_80010CB0(s32, s32); // extern
extern ? D_800DCA4C;
extern ? D_80164590;
extern ? D_801645C8;
void func_80010DBC(s32 arg0) {
s32 temp_s0;
u16 *temp_s3;
s32 phi_s0;
s16 *phi_s1;
if (*(&D_800DCA4C + (gCurrentCourseId * 4)) >= 0) {
temp_s3 = (arg0 * 2) + &D_801645C8;
phi_s0 = 0;
phi_s1 = *(&D_80164590 + (arg0 * 4));
if (*temp_s3 > 0) {
do {
*phi_s1 = func_80010CB0(arg0, phi_s0);
temp_s0 = phi_s0 + 1;
phi_s0 = temp_s0;
phi_s1 += 2;
} while (temp_s0 < *temp_s3);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010DBC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_80164580;
extern ? D_801645A0;
extern ? D_801645C8;
void func_80010E6C(s32 arg0) {
s16 temp_a0;
s16 temp_t0;
s32 temp_a1;
s32 temp_a1_2;
s32 temp_a3;
u16 temp_v0;
s32 phi_t1;
s32 phi_a1;
s16 phi_a0;
s16 *phi_a2;
s32 phi_a3;
s16 phi_a0_2;
temp_v0 = *(&D_801645C8 + (arg0 * 2));
temp_a1 = arg0 * 4;
phi_a2 = *(&D_801645A0 + temp_a1);
phi_a3 = 0;
if (temp_v0 > 0) {
do {
phi_a1 = 0;
phi_a0 = 0;
phi_a0_2 = 0;
if (temp_v0 > 0) {
phi_t1 = phi_a3;
loop_4:
temp_t0 = *(*(&D_80164580 + temp_a1) + ((phi_t1 % temp_v0) * 2));
temp_a1_2 = phi_a1 + 1;
phi_a1 = temp_a1_2;
phi_a0 = phi_a0_2;
if ((temp_t0 == 1) || (temp_t0 == 0)) {
temp_a0 = phi_a0_2 + 1;
phi_a0 = temp_a0;
phi_a0_2 = temp_a0;
if (gCurrentCourseId != 0x14) {
phi_t1 += 1;
if (temp_a1_2 != temp_v0) {
goto loop_4;
}
}
}
}
temp_a3 = phi_a3 + 1;
*phi_a2 = phi_a0;
phi_a2 += 2;
phi_a3 = temp_a3;
} while (temp_a3 != temp_v0);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010E6C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802ADDC8(? *, ?, f32, f32, f32); // extern
extern ? D_80162E70;
f32 func_80010F40(f32 arg0, f32 arg1, f32 arg2, ? arg3) {
f32 temp_a3;
f32 temp_f0;
temp_f0 = func_802AE1C0(arg0, 2000.0f, arg2);
temp_a3 = temp_f0;
arg1 = temp_f0;
func_802ADDC8(&D_80162E70, 0x3F800000, arg0, temp_a3, arg2);
return arg1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010F40.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802ADDC8(? *, ?, f32, f32, f32); // extern
extern ? D_80162E70;
f32 func_80010FA0(f32 arg0, f32 arg1, f32 arg2, ? arg3) {
f32 temp_a3;
f32 temp_f0;
temp_f0 = func_802AE1C0(arg0, arg1 + 30.0, arg2);
temp_a3 = temp_f0;
arg1 = temp_f0;
func_802ADDC8(&D_80162E70, 0x41200000, arg0, temp_a3, arg2);
return arg1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80010FA0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 func_80010F40(f32, ?, f32, s16, s32); // extern
f32 func_80010FA0(f32, f32, f32, s16, s32); // extern
s16 func_802ABD40(u16); // extern
extern f64 D_800ED068;
extern f64 D_800ED070;
extern ? D_80162E70;
s32 func_80011014(void *arg0, void *arg1, s32 arg2, ? arg3) {
f32 spE0;
f32 spDC;
f32 spD8;
f32 spD4;
f32 spD0;
f32 spCC;
f32 spC0;
f32 spB8;
f32 spAC;
f32 sp94;
s32 sp84;
f64 sp78;
f32 temp_f0;
f32 temp_f0_7;
f32 temp_f12;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f16;
f32 temp_f18;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f22;
f32 temp_f22_2;
f32 temp_f22_3;
f32 temp_f24;
f32 temp_f24_2;
f32 temp_f26;
f32 temp_f26_2;
f32 temp_f28;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f30;
f64 temp_f0_2;
f64 temp_f0_3;
f64 temp_f0_4;
f64 temp_f0_5;
f64 temp_f0_6;
f64 temp_f20_3;
f64 temp_f2_4;
s16 temp_v0_2;
s32 temp_a2;
void *temp_a0;
void *temp_s1;
void *temp_v0;
void *temp_v1;
s32 phi_s3;
f64 phi_f20;
f32 phi_f30;
void *phi_s1;
f32 phi_f28;
s32 phi_s0;
f32 phi_f0;
f32 phi_f20_2;
s32 phi_s0_2;
f32 phi_f30_2;
f32 phi_f30_3;
void *phi_s1_2;
void *phi_s1_3;
f32 phi_f28_2;
f32 phi_f28_3;
s32 phi_s0_3;
s32 phi_s0_4;
f64 phi_f0_2;
s32 phi_s0_5;
temp_f22 = arg1->unk4;
temp_f20 = arg1->unk0;
temp_f28 = func_80010F40(temp_f20, 0x44FA0000, temp_f22, gCurrentCourseId, 0);
phi_s3 = 0;
phi_s0_2 = 0;
phi_f30_2 = 0.0f;
phi_f30_3 = 0.0f;
phi_s1_2 = arg0;
phi_f28_2 = temp_f28;
phi_s0_3 = 0;
if (arg2 > 0) {
sp78 = 0.0f;
spC0 = temp_f20;
spB8 = temp_f22;
do {
temp_a2 = phi_s3 + 1;
temp_v0 = ((phi_s3 % arg2) * 8) + arg1;
temp_v1 = ((temp_a2 % arg2) * 8) + arg1;
temp_a0 = (((phi_s3 + 2) % arg2) * 8) + arg1;
temp_f26 = temp_v0->unk0;
temp_f14 = temp_v0->unk4;
temp_f20_2 = temp_v1->unk0;
temp_f22_2 = temp_v1->unk4;
spD0 = temp_a0->unk0;
temp_f0 = temp_f20_2 - temp_f26;
spDC = temp_f14;
temp_f2 = temp_f22_2 - temp_f14;
sp84 = temp_a2;
spAC = 0.0f;
spCC = temp_a0->unk4;
temp_f24 = sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2));
temp_f2_2 = spD0 - temp_f20_2;
spD8 = temp_f20_2;
spD4 = temp_f22_2;
temp_f14_2 = spCC - temp_f22_2;
spE0 = temp_f26;
sp94 = D_800ED068 / (sqrtf((temp_f2_2 * temp_f2_2) + (temp_f14_2 * temp_f14_2)) + temp_f24);
phi_f30 = phi_f30_2;
phi_s1 = phi_s1_2;
phi_f28 = phi_f28_2;
phi_s0 = phi_s0_3;
phi_s0_5 = phi_s0_3;
if (sp78 <= 1.0) {
phi_f20 = spAC;
do {
temp_f0_2 = 1.0 - phi_f20;
temp_f2_3 = temp_f0_2 * 0.5 * temp_f0_2;
temp_f14_3 = (temp_f0_2 * phi_f20) + 0.5;
temp_f16 = phi_f20 * 0.5 * phi_f20;
temp_f24_2 = (temp_f2_3 * spE0) + (temp_f14_3 * spD8) + (temp_f16 * spD0);
temp_f18 = temp_f24_2 - spC0;
temp_f26_2 = (temp_f2_3 * spDC) + (temp_f14_3 * spD4) + (temp_f16 * spCC);
temp_f22_3 = temp_f26_2 - spB8;
temp_f30 = phi_f30 + sqrtf((temp_f18 * temp_f18) + (temp_f22_3 * temp_f22_3));
spC0 = temp_f24_2;
spB8 = temp_f26_2;
phi_s1_3 = phi_s1;
phi_f28_3 = phi_f28;
phi_s0_4 = phi_s0;
if ((temp_f30 > 20.0f) || ((phi_f30_3 = temp_f30, (phi_s3 == 0)) && (phi_f30_3 = temp_f30, (phi_f20 == 0.0)))) {
if (gIsMirrorMode != 0) {
temp_f12 = -temp_f24_2;
phi_s1->unk0 = temp_f12;
phi_f0 = func_80010FA0(temp_f12, phi_f28, temp_f26_2, gCurrentCourseId, phi_s0);
} else {
phi_s1->unk0 = temp_f24_2;
phi_f0 = func_80010FA0(temp_f24_2, phi_f28, temp_f26_2, gCurrentCourseId, phi_s0);
}
phi_s1->unk4 = temp_f26_2;
phi_s1->unk6 = func_802ABD40(D_80162E70.unkA);
temp_f2_4 = phi_f0;
phi_f20_2 = phi_f0;
if (temp_f2_4 < D_800ED070) {
phi_f20_2 = phi_f28;
} else {
temp_v0_2 = gCurrentCourseId;
if (temp_v0_2 != 0xD) {
if (temp_v0_2 != 0xE) {
if (temp_v0_2 != 0x12) {
temp_f0_3 = phi_f28 - 10.0;
phi_f0_2 = temp_f0_3;
if (temp_f2_4 < temp_f0_3) {
goto block_29;
}
} else if ((phi_s0 >= 0xCD) && (phi_s0 < 0xDC)) {
phi_f20_2 = phi_f28;
} else {
temp_f0_4 = phi_f28;
if (temp_f2_4 < (temp_f0_4 - 10.0)) {
phi_f20_2 = temp_f0_4 - 4.0;
}
}
} else if ((phi_s0 >= 0x474) && (phi_s0 < 0x481)) {
phi_f20_2 = phi_f28;
} else {
temp_f0_5 = phi_f28;
if (temp_f2_4 < (temp_f0_5 - 10.0)) {
phi_f20_2 = temp_f0_5 - 4.0;
}
}
} else {
temp_f0_6 = phi_f28 - 15.0;
phi_f0_2 = temp_f0_6;
if (temp_f2_4 < temp_f0_6) {
block_29:
phi_f20_2 = phi_f0_2;
}
}
}
temp_s1 = phi_s1 + 8;
temp_s1->unk-6 = phi_f20_2;
phi_s1_3 = temp_s1;
phi_f28_3 = phi_f20_2;
phi_s0_4 = phi_s0 + 1;
}
temp_f0_7 = spAC + sp94;
temp_f20_3 = temp_f0_7;
spAC = temp_f0_7;
phi_f20 = temp_f20_3;
phi_f30 = phi_f30_3;
phi_s1 = phi_s1_3;
phi_f28 = phi_f28_3;
phi_s0 = phi_s0_4;
phi_s0_5 = phi_s0_4;
phi_f30_2 = phi_f30_3;
phi_s1_2 = phi_s1_3;
phi_f28_2 = phi_f28_3;
} while (temp_f20_3 <= 1.0);
}
phi_s3 = sp84;
phi_s0_2 = phi_s0_5;
phi_s0_3 = phi_s0_5;
} while (sp84 != arg2);
}
return phi_s0_2;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011014.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 process_path_data(void *arg0, void *arg1) {
s16 temp_a0;
s16 temp_a2;
s16 temp_a3;
s32 temp_v0;
s32 temp_v1;
void *phi_a1;
void *phi_s0;
s32 phi_v0;
s32 phi_v1;
s32 phi_v1_2;
phi_a1 = arg1;
phi_s0 = arg0;
phi_v0 = 0;
phi_v1_2 = 0;
loop_1:
temp_a0 = phi_a1->unk0;
temp_a2 = phi_a1->unk2;
temp_a3 = phi_a1->unk4;
phi_a1 += 8;
phi_v1 = phi_v1_2;
if (((temp_a0 & 0xFFFF) != 0x8000) || ((temp_a2 & 0xFFFF) != 0x8000) || ((temp_a3 & 0xFFFF) != 0x8000)) {
temp_v0 = phi_v0 + 1;
temp_v1 = phi_v1_2 + 1;
phi_v0 = temp_v0;
phi_v1 = temp_v1;
phi_v1_2 = temp_v1;
if (gIsMirrorMode != 0) {
phi_s0->unk0 = -temp_a0;
} else {
phi_s0->unk0 = temp_a0;
}
phi_s0->unk2 = temp_a2;
phi_s0->unk4 = temp_a3;
phi_s0->unk6 = phi_a1->unk6;
phi_s0 += 8;
if (temp_v0 != 0x7D0) {
goto loop_1;
}
}
return phi_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/process_path_data.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f64 D_800ED078;
s32 func_8001168C(s16 *arg0, void *arg1, s32 arg2) {
f32 spC8;
f32 spC4;
f32 spC0;
f32 spBC;
f32 spB8;
f32 spB4;
f32 spA8;
f32 spA0;
f32 sp94;
f32 sp84;
f32 sp7C;
f64 sp68;
f32 temp_f0;
f32 temp_f0_3;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f18;
f32 temp_f18_2;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f22;
f32 temp_f24;
f32 temp_f26;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f6;
f64 temp_f0_2;
f64 temp_f20_3;
s16 *temp_s0;
s32 temp_s5;
void *temp_a0;
void *temp_v0;
void *temp_v1;
s32 phi_s2;
f64 phi_f20;
s16 *phi_s0;
s32 phi_s1;
s16 *phi_s0_2;
s16 *phi_s0_3;
s32 phi_s1_2;
s32 phi_s1_3;
s32 phi_s1_4;
s32 phi_s1_5;
sp84 = 0.0f;
spA8 = arg1->unk0;
spA0 = arg1->unk4;
phi_s2 = 0;
phi_s1 = 0;
phi_s0_2 = arg0;
phi_s1_3 = 0;
if (arg2 > 0) {
sp68 = 0.0f;
do {
temp_s5 = phi_s2 + 1;
temp_v0 = ((phi_s2 % arg2) * 8) + arg1;
temp_v1 = ((temp_s5 % arg2) * 8) + arg1;
temp_a0 = (((phi_s2 + 2) % arg2) * 8) + arg1;
temp_f14 = temp_v0->unk0;
temp_f16 = temp_v0->unk4;
temp_f18 = temp_v1->unk0;
temp_f20 = temp_v1->unk4;
spB8 = temp_a0->unk0;
temp_f0 = temp_f18 - temp_f14;
spBC = temp_f20;
temp_f2 = temp_f20 - temp_f16;
spC0 = temp_f18;
spC4 = temp_f16;
spC8 = temp_f14;
sp94 = 0.0f;
spB4 = temp_a0->unk4;
temp_f2_2 = spB8 - spC0;
temp_f20_2 = sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2));
temp_f14_2 = spB4 - spBC;
sp7C = D_800ED078 / (sqrtf((temp_f2_2 * temp_f2_2) + (temp_f14_2 * temp_f14_2)) + temp_f20_2);
phi_s0 = phi_s0_2;
phi_s1_2 = phi_s1_3;
phi_s1_5 = phi_s1_3;
if (sp68 <= 1.0) {
phi_f20 = sp94;
do {
temp_f0_2 = 1.0 - phi_f20;
temp_f2_3 = temp_f0_2 * 0.5 * temp_f0_2;
temp_f14_3 = (temp_f0_2 * phi_f20) + 0.5;
temp_f16_2 = phi_f20 * 0.5 * phi_f20;
temp_f24 = (temp_f2_3 * spC8) + (temp_f14_3 * spC0) + (temp_f16_2 * spB8);
temp_f18_2 = temp_f24 - spA8;
temp_f26 = (temp_f2_3 * spC4) + (temp_f14_3 * spBC) + (temp_f16_2 * spB4);
temp_f22 = temp_f26 - spA0;
temp_f6 = sp84 + sqrtf((temp_f18_2 * temp_f18_2) + (temp_f22 * temp_f22));
spA8 = temp_f24;
spA0 = temp_f26;
sp84 = temp_f6;
phi_s0_3 = phi_s0;
phi_s1_4 = phi_s1_5;
if ((temp_f6 > 20.0f) || ((phi_s2 == 0) && (phi_f20 == 0.0))) {
phi_s1_4 = phi_s1_5 + 1;
if (gIsMirrorMode != 0) {
*phi_s0 = -temp_f24;
} else {
*phi_s0 = temp_f24;
}
temp_s0 = phi_s0 + 4;
temp_s0->unk-2 = temp_f26;
sp84 = 0.0f;
phi_s0_3 = temp_s0;
}
temp_f0_3 = sp94 + sp7C;
temp_f20_3 = temp_f0_3;
sp94 = temp_f0_3;
phi_f20 = temp_f20_3;
phi_s0 = phi_s0_3;
phi_s1_2 = phi_s1_4;
phi_s0_2 = phi_s0_3;
phi_s1_5 = phi_s1_4;
} while (temp_f20_3 <= 1.0);
}
phi_s2 = temp_s5;
phi_s1 = phi_s1_2;
phi_s1_3 = phi_s1_2;
} while (temp_s5 != arg2);
}
return phi_s1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001168C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void *segmented_to_virtual_dupe(void*); // extern
extern s32 D_800DC720;
extern ? D_80162EB8;
extern ? D_80162F08;
void func_80011A5C(void) {
? *temp_s0;
s32 *phi_s1;
? *phi_s0;
phi_s1 = &D_800DC720;
phi_s0 = &D_80162EB8;
do {
temp_s0 = phi_s0 + 4;
temp_s0->unk-4 = segmented_to_virtual_dupe(*phi_s1);
phi_s1 += 4;
phi_s0 = temp_s0;
} while (temp_s0 != &D_80162F08);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011A5C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801632B8;
extern ? D_801632D0;
extern ? D_801632E8;
void func_80011AB8(s32 arg0) {
s32 temp_v0;
temp_v0 = arg0 * 2;
*(&D_801632B8 + temp_v0) = 0;
*(&D_801632D0 + temp_v0) = 0;
*(&D_801632E8 + temp_v0) = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011AB8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801632B8;
extern ? D_801632D0;
extern ? D_801632E8;
void func_80011AE4(s32 arg0) {
s32 temp_v0;
temp_v0 = arg0 * 2;
*(&D_801632B8 + temp_v0) = 0;
*(&D_801632D0 + temp_v0) = 0;
*(&D_801632E8 + temp_v0) = 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011AE4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_80011AB8(u16, u16 *); /* extern */
? func_80011EC0(s32, u16); /* extern */
? func_8002AA50(void *, u16, u16 *); /* extern */
extern ? D_80162EB8;
extern ? D_801630E8;
extern ? D_801631E0;
extern ? D_801632B8;
extern ? D_801632D0;
extern ? D_801632E8;
extern ? D_80163350;
extern ? D_801633F8;
extern ? D_801634FC;
extern ? D_80164438;
s16 gCurrentCourseId; /* unable to generate initializer */
void func_80011B14(s32 arg0, void *arg1) {
u16 sp2E;
s32 sp1C;
s16 temp_t1;
s32 temp_t3;
s32 temp_v1;
u16 *temp_a3;
u16 temp_a2;
void *temp_t0;
void *temp_t6;
temp_v1 = arg0 * 2;
temp_a3 = temp_v1 + &D_801632B8;
temp_a2 = *temp_a3;
temp_t0 = *(&D_80162EB8 + (gCurrentCourseId * 4));
temp_t6 = (temp_a2 * 8) + temp_t0;
D_801632B0 = temp_t6;
sp2E = *(&D_80164438 + temp_v1);
temp_t1 = temp_t6->unk0;
temp_t3 = temp_t6->unk4;
if ((temp_t1 == -1) && (temp_t6->unk2 == -1)) {
D_801632B0 = temp_t0;
func_80011AB8(temp_a2, temp_a3);
return;
}
if (sp2E == temp_t1) {
*(&D_801632E8 + temp_v1) = 2;
*(&D_801632D0 + temp_v1) = temp_a2;
*temp_a3 = temp_a2 + 1;
switch (temp_t3) {
case 1:
func_80011EC0(arg1->unk7C >> 0x10, sp2E);
return;
case 2:
sp1C = temp_v1;
func_8002AA50(arg1, temp_a2, temp_a3);
arg1->unkBC = arg1->unkBC & ~0x10;
*(&D_801630E8 + temp_v1) = 0;
return;
case 3:
*(&D_801634FC + (arg0 * 0x10)) = 0.0f;
return;
case 4:
*(&D_801634FC + (arg0 * 0x10)) = -0.6f;
return;
case 5:
*(&D_801634FC + (arg0 * 0x10)) = 0.6f;
return;
case 6:
*(&D_80163350 + temp_v1) = 0;
return;
case 7:
*(&D_80163350 + temp_v1) = 1;
return;
case 8:
*(&D_80163350 + temp_v1) = 2;
return;
case 11:
*(&D_80163350 + temp_v1) = 3;
return;
case 9:
*(&D_801633F8 + temp_v1) = 1;
*(&D_801631E0 + temp_v1) = 0;
gPlayers[arg0].unk_0BC &= -0x1001;
return;
case 10:
*(&D_801633F8 + temp_v1) = 0;
/* Duplicate return node #17. Try simplifying control flow for better match */
return;
}
} else {
default:
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011B14.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
extern ? D_80162EB8;
extern ? D_801630E8;
extern ? D_801632D0;
extern ? D_801632E8;
extern ? D_801634F8;
extern ? D_80164438;
s16 gCurrentCourseId; /* unable to generate initializer */
void func_80011D48(s32 arg0, void *arg1) {
s32 temp_a2;
s32 temp_v0;
void *temp_t3;
void *temp_v1;
temp_v0 = arg0 * 2;
temp_t3 = (*(&D_801632D0 + temp_v0) * 8) + *(&D_80162EB8 + (gCurrentCourseId * 4));
D_801632B0 = temp_t3;
temp_a2 = temp_t3->unk4;
if (*(&D_80164438 + temp_v0) >= temp_t3->unk2) {
switch (temp_a2) {
case 1:
arg1->unkBC = arg1->unkBC & ~0x10;
*(&D_801630E8 + temp_v0) = 0;
*(&D_801632E8 + temp_v0) = 1;
return;
case 3:
case 4:
case 5:
temp_v1 = (arg0 * 0x10) + &D_801634F8;
temp_v1->unk4 = temp_v1->unkC;
*(&D_801632E8 + temp_v0) = 1;
return;
case 2:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
*(&D_801632E8 + temp_v0) = 1;
/* Duplicate return node #6. Try simplifying control flow for better match */
return;
}
} else {
default:
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011D48.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80011B14(Player *); // extern
? func_80011D48(Player *); // extern
extern ? D_801632E8;
void func_80011E38(s32 arg0) {
Player *temp_a1;
u16 temp_v0;
temp_v0 = *(&D_801632E8 + (arg0 * 2));
temp_a1 = &gPlayerOne[arg0];
if (temp_v0 != 0) {
if (temp_v0 != 1) {
if (temp_v0 != 2) {
return;
}
func_80011D48(temp_a1);
// Duplicate return node #6. Try simplifying control flow for better match
return;
}
func_80011B14(temp_a1);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011E38.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8002AA50(void *, s16 *, s32); // extern
extern f64 D_800ED0E0;
extern f64 D_800ED0E8;
extern s16 D_80162FCE;
extern ? D_80162FF8;
extern ? D_80163068;
extern ? D_801630E8;
extern s32 D_801631D8;
void func_80011EC0(s32 arg0, void *arg1, s32 arg2, ? arg3) {
s16 *sp1C;
f64 temp_f0;
f64 temp_f0_2;
s16 *temp_a2;
s16 temp_v0;
s32 temp_v1;
temp_v1 = arg0 * 2;
temp_a2 = temp_v1 + &D_801630E8;
if ((((arg1->unk94 / 18.0f) * 216.0f) >= 45.0f) && (*temp_a2 == 0)) {
temp_v0 = *(D_801631D8 + (D_80162FCE * 2));
if (temp_v0 != 0) {
if (temp_v0 != 1) {
if (temp_v0 != 2) {
if (temp_v0 != 3) {
return;
}
goto block_13;
}
goto block_7;
}
block_13:
if ((arg2 < 0xA) && (*(&D_80162FF8 + temp_v1) == 0) && (temp_f0 = *(&D_80163068 + (arg0 * 4)), (temp_f0 > -0.5)) && (temp_f0 < D_800ED0E8)) {
sp1C = temp_a2;
func_8002AA50(arg1, temp_a2, arg2);
arg1->unkBC = arg1->unkBC | 0x10;
*temp_a2 = -1;
return;
}
*temp_a2 = -2;
return;
}
block_7:
if ((arg2 >= -9) && (*(&D_80162FF8 + temp_v1) == 0) && (temp_f0_2 = *(&D_80163068 + (arg0 * 4)), (D_800ED0E0 < temp_f0_2)) && (temp_f0_2 < 0.5)) {
sp1C = temp_a2;
func_8002AA50(arg1, temp_a2, arg2);
arg1->unkBC = arg1->unkBC | 0x10;
*temp_a2 = 1;
return;
}
*temp_a2 = 2;
return;
}
*(&D_801630E8 + (arg0 * 2)) = 3;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011EC0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8001168C(void *, u16 *, s32); // extern
extern ? D_06006C60;
extern s16 D_80162EB0;
extern void *D_80163598;
extern s32 D_8016359C;
extern ? gSegmentTable;
void func_800120C8(void) {
void *sp18;
u16 *temp_a1;
void *temp_a0;
u16 *phi_v0;
s32 phi_v1;
temp_a1 = *(&gSegmentTable + ((&D_06006C60 >> 0x18) * 4)) + (&D_06006C60 & 0xFFFFFF) + 0x80000000;
phi_v0 = temp_a1;
phi_v1 = 0;
loop_1:
phi_v0 += 8;
if (*phi_v0 != 0x8000) {
phi_v1 += 1;
goto loop_1;
}
temp_a0 = D_80163598;
sp18 = temp_a0;
D_8016359C = func_8001168C(temp_a0, temp_a1, phi_v1 - 1);
D_80162EB0 = func_802AE1C0(temp_a0->unk0, 2000.0f, temp_a0->unk2);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800120C8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8001168C(s32, u16 *, s32); // extern
extern ? D_06007520;
extern s16 D_80162EB2;
extern s32 D_80163598;
extern s32 D_8016359C;
extern ? gSegmentTable;
void func_80012190(void) {
u16 *temp_a1;
u16 *phi_v0;
s32 phi_v1;
temp_a1 = *(&gSegmentTable + ((&D_06007520 >> 0x18) * 4)) + (&D_06007520 & 0xFFFFFF) + 0x80000000;
phi_v0 = temp_a1;
phi_v1 = 0;
loop_1:
phi_v0 += 8;
if (*phi_v0 != 0x8000) {
phi_v1 += 1;
goto loop_1;
}
D_8016359C = func_8001168C(D_80163598, temp_a1, phi_v1 - 1);
D_80162EB2 = -0x28;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012190.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000D6D0(void *, void *, s32, s32, s32, s32); // extern
? func_8000D940(void *, void *, s32, s32, s32); // extern
extern s16 D_8016347A;
void func_80012220(void *arg0) {
f32 sp34;
f32 sp2C;
sp34 = arg0->unk4;
sp2C = arg0->unkC;
if (D_8016347A == 0) {
func_8000D6D0(arg0 + 4, arg0 + 0x1C, arg0->unk20, arg0->unk24, 0, 3);
arg0->unk28 = 0;
arg0->unk2A = -0x8000;
} else {
func_8000D940(arg0 + 4, arg0 + 0x1C, arg0->unk20, arg0->unk24, 0);
arg0->unk28 = 0;
arg0->unk2A = 0;
}
arg0->unk2C = 0;
arg0->unk10 = arg0->unk4 - sp34;
arg0->unk18 = arg0->unkC - sp2C;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012220.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8000DBAC(? *, ? *, s32); // extern
? func_80012220(? *); // extern
s16 func_8029EC88(? *, ? *, ? *, ?); // extern
? func_802B52BC(? *, ?, s16, ?); // extern
extern ? D_801635A0;
extern ? D_801635A4;
extern ? D_801635B0;
extern ? D_801635BC;
extern ? D_801637C0;
extern ? D_801637C8;
extern ? D_801637EC;
extern ? D_80163818;
extern ? D_8016381C;
extern ? D_80163828;
extern ? D_80163840;
extern ? D_80163988;
extern ? D_8016398C;
extern ? D_80163994;
extern ? D_80163998;
extern ? D_801639B0;
extern ? D_80163AF8;
extern ? D_80163AFC;
extern ? D_80163B04;
extern ? D_80163B08;
extern ? D_80163B20;
extern ? D_80163C68;
extern ? D_80163C6C;
extern ? D_80163C74;
extern ? D_80163C78;
extern ? D_80163C90;
extern ? D_80163DE4;
void func_800122D8(void) {
? spAC;
? sp90;
? *sp74;
? *sp70;
? *sp68;
? *sp54;
? *temp_s0;
? *temp_s1;
? *temp_s1_2;
? *temp_s1_3;
? *temp_s1_4;
? *temp_s1_5;
? *temp_s1_6;
? *temp_s1_7;
? *temp_t0;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f20_3;
f32 temp_f20_4;
f32 temp_f22;
f32 temp_f22_2;
f32 temp_f22_3;
f32 temp_f22_4;
s16 temp_a2;
s16 temp_a2_2;
s16 temp_a2_3;
s16 temp_v0;
s32 temp_s3;
void *temp_s0_2;
void *temp_s0_3;
? *phi_s0;
? *phi_s6;
? *phi_s2;
s32 phi_s3;
? *phi_s0_2;
? *phi_s2_2;
? *phi_s3_2;
? *phi_s1;
? *phi_s0_3;
? *phi_s2_3;
? *phi_s3_3;
? *phi_s1_2;
? *phi_s0_4;
? *phi_s2_4;
? *phi_s3_4;
? *phi_s1_3;
? *phi_s0_5;
? *phi_s2_5;
? *phi_s3_5;
? *phi_s1_4;
temp_v0 = gCurrentCourseId;
if (temp_v0 != 0xA) {
if (temp_v0 != 0xB) {
if (temp_v0 != 0x12) {
return;
}
phi_s0 = &D_801637C0;
do {
temp_s1 = phi_s0 + 4;
if (phi_s0->unk0 == 1) {
temp_f20 = phi_s0->unk4;
temp_f22 = phi_s0->unkC;
phi_s0->unk24 = func_8000DBAC(temp_s1, phi_s0 + 0x1C, phi_s0->unk20);
phi_s0->unk10 = phi_s0->unk4 - temp_f20;
phi_s0->unk18 = phi_s0->unkC - temp_f22;
func_802B52BC(&sp90, 0, phi_s0->unk24, 0);
phi_s0->unk1E = func_8029EC88(temp_s1, &sp90, phi_s0 + 0x10, 0x26);
}
temp_s0 = phi_s0 + 0x2C;
phi_s0 = temp_s0;
} while (temp_s0 != &D_801637EC);
return;
}
sp68 = &D_801635A0;
sp74 = &D_801635A4;
sp70 = &D_801635BC;
sp54 = &D_801635B0;
phi_s6 = &D_801635A0;
do {
temp_f20_2 = phi_s6->unk4;
temp_f22_2 = phi_s6->unkC;
temp_a2 = func_8000DBAC(sp74, sp70, phi_s6->unkFC);
phi_s6->unk10 = phi_s6->unk4 - temp_f20_2;
phi_s6->unk18 = phi_s6->unkC - temp_f22_2;
func_802B52BC(&spAC, 0, temp_a2, 0);
temp_s0_2 = phi_s6 + 0x24;
phi_s6->unk1E = func_8029EC88(sp74, &spAC, sp54, 0xF);
temp_s1_2 = temp_s0_2 + 4;
if (phi_s6->unk24 == 1) {
temp_f20_3 = temp_s0_2->unk4;
temp_f22_3 = temp_s0_2->unkC;
temp_a2_2 = func_8000DBAC(temp_s1_2, temp_s0_2 + 0x1C, phi_s6->unkFC);
temp_s0_2->unk10 = temp_s0_2->unk4 - temp_f20_3;
temp_s0_2->unk18 = temp_s0_2->unkC - temp_f22_3;
func_802B52BC(&spAC, 0, temp_a2_2, 0);
temp_s0_2->unk1E = func_8029EC88(temp_s1_2, &spAC, temp_s0_2 + 0x10, 0x10);
}
phi_s2 = sp68;
phi_s3 = 0;
loop_8:
temp_s0_3 = phi_s2 + 0x48;
temp_s1_3 = temp_s0_3 + 4;
if (phi_s2->unk48 == 1) {
temp_f20_4 = temp_s0_3->unk4;
temp_f22_4 = temp_s0_3->unkC;
temp_a2_3 = func_8000DBAC(temp_s1_3, temp_s0_3 + 0x1C, phi_s6->unkFC);
temp_s0_3->unk10 = temp_s0_3->unk4 - temp_f20_4;
temp_s0_3->unk18 = temp_s0_3->unkC - temp_f22_4;
func_802B52BC(&spAC, 0, temp_a2_3, 0);
temp_s0_3->unk1E = func_8029EC88(temp_s1_3, &spAC, temp_s0_3 + 0x10, 0x11);
}
temp_s3 = phi_s3 + 0x24;
phi_s2 += 0x24;
phi_s3 = temp_s3;
if (temp_s3 != 0xB4) {
goto loop_8;
}
temp_t0 = sp54 + 0x10C;
sp54 = temp_t0;
sp68 += 0x10C;
sp70 += 0x10C;
sp74 += 0x10C;
phi_s6 += 0x10C;
} while (temp_t0 != &D_801637C8);
return;
}
phi_s0_2 = &D_80163818;
phi_s2_2 = &D_8016381C;
phi_s3_2 = &D_80163840;
phi_s1 = &D_80163828;
do {
func_80012220(phi_s0_2);
temp_s1_4 = phi_s1 + 0x34;
phi_s0_2->unk1E = func_8029EC88(phi_s2_2, phi_s3_2, phi_s1, 0x25);
phi_s0_2 += 0x34;
phi_s2_2 += 0x34;
phi_s3_2 += 0x34;
phi_s1 = temp_s1_4;
} while (temp_s1_4 < &D_80163994);
phi_s0_3 = &D_80163988;
phi_s2_3 = &D_8016398C;
phi_s3_3 = &D_801639B0;
phi_s1_2 = &D_80163998;
do {
func_80012220(phi_s0_3);
temp_s1_5 = phi_s1_2 + 0x34;
phi_s0_3->unk1E = func_8029EC88(phi_s2_3, phi_s3_3, phi_s1_2, 0x28);
phi_s0_3 += 0x34;
phi_s2_3 += 0x34;
phi_s3_3 += 0x34;
phi_s1_2 = temp_s1_5;
} while (temp_s1_5 < &D_80163B04);
phi_s0_4 = &D_80163AF8;
phi_s2_4 = &D_80163AFC;
phi_s3_4 = &D_80163B20;
phi_s1_3 = &D_80163B08;
do {
func_80012220(phi_s0_4);
temp_s1_6 = phi_s1_3 + 0x34;
phi_s0_4->unk1E = func_8029EC88(phi_s2_4, phi_s3_4, phi_s1_3, 0x29);
phi_s0_4 += 0x34;
phi_s2_4 += 0x34;
phi_s3_4 += 0x34;
phi_s1_3 = temp_s1_6;
} while (temp_s1_6 < &D_80163C74);
phi_s0_5 = &D_80163C68;
phi_s2_5 = &D_80163C6C;
phi_s3_5 = &D_80163C90;
phi_s1_4 = &D_80163C78;
do {
func_80012220(phi_s0_5);
temp_s1_7 = phi_s1_4 + 0x34;
phi_s0_5->unk1E = func_8029EC88(phi_s2_5, phi_s3_5, phi_s1_4, 0x2C);
phi_s0_5 += 0x34;
phi_s2_5 += 0x34;
phi_s3_5 += 0x34;
phi_s1_4 = temp_s1_7;
} while (temp_s1_7 != &D_80163DE4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800122D8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80162EB0;
void func_80012780(void *arg0, void *arg1, s16 arg2) {
arg0->unk4 = arg1->unk0;
arg0->unk8 = D_80162EB0;
arg0->unk1E = -1;
arg0->unk1C = arg2;
arg0->unk0 = 0;
arg0->unk10 = 0.0f;
arg0->unk14 = 0.0f;
arg0->unk18 = 0.0f;
arg0->unkC = arg1->unk2;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012780.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80012780(? *, s32, s32); // extern
extern s16 D_80162FCC;
extern s32 D_80163598;
extern s32 D_8016359C;
extern ? D_801635A0;
extern ? D_801635C4;
extern ? D_801637B8;
void func_800127E0(void) {
? *sp4C;
? *temp_a2;
? *temp_s6;
? *temp_s6_2;
? *temp_s6_3;
s32 temp_fp;
s32 temp_s1;
s32 temp_t3;
s32 temp_t6;
s32 temp_t9;
s32 temp_v0;
s32 temp_v0_2;
void *temp_v0_3;
? *phi_s6;
? *phi_s2;
s32 phi_s0;
s32 phi_s1;
s32 phi_fp;
? *phi_s6_2;
? *phi_s6_3;
? *phi_a2;
? *phi_s7;
? *phi_s7_2;
sp4C = &D_801635C4;
phi_s6 = &D_801635A0;
phi_fp = 0;
phi_s7_2 = &D_801635A0;
do {
temp_v0 = D_8016359C;
phi_s6->unkFC = 5.0f;
phi_s2 = phi_s7_2 + 0x48;
phi_s0 = ((((phi_fp * temp_v0) / 2) + 0xA0) % temp_v0) & 0xFFFF;
phi_s1 = 0;
loop_2:
temp_t3 = (phi_s0 + 4) & 0xFFFF;
func_80012780(phi_s2, (temp_t3 * 4) + D_80163598, temp_t3 & 0xFFFF);
temp_s1 = phi_s1 + 0x24;
phi_s2 += 0x24;
phi_s0 = temp_t3;
phi_s1 = temp_s1;
if (temp_s1 != 0xB4) {
goto loop_2;
}
temp_t6 = (temp_t3 + 3) & 0xFFFF;
func_80012780(sp4C, (temp_t6 * 4) + D_80163598, temp_t6 & 0xFFFF);
temp_t9 = (temp_t6 + 4) & 0xFFFF;
func_80012780(phi_s6, (temp_t9 * 4) + D_80163598, temp_t9 & 0xFFFF);
temp_fp = phi_fp + 1;
sp4C += 0x10C;
temp_s6 = phi_s6 + 0x10C;
temp_s6->unk-8 = 0;
phi_s6 = temp_s6;
phi_fp = temp_fp;
phi_s7_2 += 0x10C;
} while (temp_fp < 2);
temp_v0_2 = gScreenModeSelection;
phi_s6_3 = &D_801635A0;
phi_a2 = &D_801635A0;
if (temp_v0_2 != 0) {
if ((temp_v0_2 != 1) && (temp_v0_2 != 2)) {
} else {
phi_s6_2 = &D_801635A0;
if (gModeSelection != GRAND_PRIX) {
do {
temp_s6_2 = phi_s6_2 + 0x10C;
temp_s6_2->unk-E8 = 1;
temp_s6_2->unk-34 = 1;
temp_s6_2->unk-8 = 2;
phi_s6_2 = temp_s6_2;
} while (temp_s6_2 != &D_801637B8);
}
}
} else {
phi_s7 = &D_801635A0;
do {
phi_s6_3->unk24 = 1;
phi_a2->unk48 = 1;
temp_a2 = phi_a2 + 0x10C;
temp_s6_3 = phi_s6_3 + 0x10C;
temp_v0_3 = phi_s7 + (1 * 0x24);
temp_v0_3->unk48 = 1;
temp_v0_3->unk6C = 1;
temp_v0_3->unk90 = 1;
temp_v0_3->unkB4 = 1;
temp_s6_3->unk-8 = 6;
phi_s6_3 = temp_s6_3;
phi_a2 = temp_a2;
phi_s7 += 0x10C;
} while (temp_a2 != &D_801637B8);
}
D_80162FCC = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800127E0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_8015F9B8;
void func_80012A48(void *arg0, s16 arg1) {
void *temp_v0;
temp_v0 = (arg0->unk1E * 0x70) + &D_8015F9B8;
temp_v0->unk18 = arg0->unk4;
temp_v0->unk1C = arg0->unk8;
temp_v0->unk20 = arg0->unkC;
if (gIsMirrorMode != 0) {
temp_v0->unk12 = -arg1;
} else {
temp_v0->unk12 = arg1;
}
temp_v0->unk24 = arg0->unk10;
temp_v0->unk2C = arg0->unk18;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012A48.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80006114(f32 *, ? *, s16); // extern
s32 func_800061DC(? *, ?, s32); // extern
s16 func_8000DBAC(? *, ? *, s32); // extern
? func_80012A48(? *, s16); // extern
? func_800755FC(s32, f32 *, f32); // extern
? func_800C98B8(? *, void *, ?); // extern
extern f32 D_800ED0F0;
extern f64 D_800ED0F8;
extern s16 D_80162FCC;
extern ? D_801635A0;
extern ? D_801635A4;
extern ? D_801635BC;
void func_80012AC0(void) {
f32 sp98;
f32 sp94;
f32 sp90;
? *sp7C;
? *temp_s0_2;
? *temp_s0_3;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f20_3;
f32 temp_f22;
f32 temp_f22_2;
f32 temp_f22_3;
f32 temp_f30;
f64 temp_f24;
s16 temp_a1;
s16 temp_a1_2;
s16 temp_s1;
s16 temp_t0;
s16 temp_v0;
s32 temp_s2;
s32 temp_s7;
s32 temp_v0_3;
u16 temp_s0;
u16 temp_v0_2;
? *phi_s6;
? *phi_fp;
? *phi_s3;
s32 phi_s7;
? *phi_s1;
s32 phi_s2;
D_80162FCC = D_80162FCC + 1;
temp_f30 = D_800ED0F0;
temp_f24 = D_800ED0F8;
sp7C = &D_801635A0;
phi_s6 = &D_801635A4;
phi_fp = &D_801635BC;
phi_s3 = &D_801635A0;
phi_s7 = 0;
do {
temp_s0 = phi_s3->unk1C;
temp_f20 = phi_s3->unk4;
temp_f22 = phi_s3->unkC;
temp_v0 = func_8000DBAC(phi_s6, phi_fp, phi_s3->unkFC);
temp_t0 = temp_v0;
temp_s1 = temp_v0;
phi_s3->unk10 = phi_s3->unk4 - temp_f20;
phi_s3->unk18 = phi_s3->unkC - temp_f22;
func_80012A48(phi_s3, temp_t0);
temp_v0_2 = phi_s3->unk1C;
if ((temp_s0 != temp_v0_2) && ((temp_v0_2 == 0xBE) || (temp_v0_2 == 0x140))) {
func_800C98B8(phi_s6, phi_s3 + 0x10, 0x1901800E);
} else if (random_int(0x64) == 0) {
func_800C98B8(phi_s6, phi_s3 + 0x10, 0x1901800D);
}
temp_v0_3 = func_800061DC(phi_s6, 0x44FA0000, phi_s3->unk100);
phi_s3->unk100 = temp_v0_3;
if (((D_80162FCC % 5) == 0) && (temp_v0_3 != 0)) {
sp90 = phi_s3->unk4;
sp94 = phi_s3->unk8 + temp_f24;
sp98 = phi_s3->unkC + 25.0;
func_80006114(&sp90, phi_s6, temp_s1);
func_800755FC(phi_s7, &sp90, temp_f30);
}
temp_s0_2 = phi_s3 + 0x24;
if (phi_s3->unk24 == 1) {
temp_f20_2 = temp_s0_2->unk4;
temp_f22_2 = temp_s0_2->unkC;
temp_a1 = func_8000DBAC(temp_s0_2 + 4, temp_s0_2 + 0x1C, phi_s3->unkFC);
temp_s0_2->unk10 = temp_s0_2->unk4 - temp_f20_2;
temp_s0_2->unk18 = temp_s0_2->unkC - temp_f22_2;
func_80012A48(temp_s0_2, temp_a1);
}
phi_s1 = sp7C;
phi_s2 = 0;
loop_13:
temp_s0_3 = phi_s1 + 0x48;
if (phi_s1->unk48 == 1) {
temp_f20_3 = temp_s0_3->unk4;
temp_f22_3 = temp_s0_3->unkC;
temp_a1_2 = func_8000DBAC(temp_s0_3 + 4, temp_s0_3 + 0x1C, phi_s3->unkFC);
temp_s0_3->unk10 = temp_s0_3->unk4 - temp_f20_3;
temp_s0_3->unk18 = temp_s0_3->unkC - temp_f22_3;
func_80012A48(temp_s0_3, temp_a1_2);
}
temp_s2 = phi_s2 + 0x24;
phi_s1 += 0x24;
phi_s2 = temp_s2;
if (temp_s2 != 0xB4) {
goto loop_13;
}
temp_s7 = phi_s7 + 1;
sp7C += 0x10C;
phi_s6 += 0x10C;
phi_fp += 0x10C;
phi_s3 += 0x10C;
phi_s7 = temp_s7;
} while (temp_s7 != 2);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012AC0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80006018(f32, f32, s32, s32, f32, f32, f32, f32); // extern
extern ? D_801631E0;
extern ? D_801635A0;
extern ? D_801637B8;
void func_80012DC0(s32 arg0, void *arg1) {
f32 sp84;
? *temp_s7;
f32 temp_f14;
f32 temp_f16;
f32 temp_f24;
f32 temp_f26;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f0_3;
f64 temp_f0_4;
s32 temp_s1;
void *temp_v0;
void *temp_v0_2;
? *phi_s6;
? *phi_s0;
s32 phi_s1;
? *phi_s7;
if (*(&D_801631E0 + (arg0 * 2)) != 1) {
phi_s6 = &D_801635A0;
phi_s7 = &D_801635A0;
if ((arg1->unkBC << 7) >= 0) {
temp_f24 = arg1->unk14;
temp_f26 = arg1->unk1C;
do {
temp_f16 = phi_s6->unk4;
temp_f14 = phi_s6->unkC;
sp84 = temp_f16;
temp_f0 = temp_f24 - temp_f16;
if ((temp_f0 > -100.0) && (temp_f0 < 100.0)) {
temp_f0_2 = temp_f26 - temp_f14;
if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0)) {
if (func_80006018(sp84, temp_f14, phi_s6->unk10, phi_s6->unk18, 60.0f, 20.0f, temp_f24, temp_f26) == 1) {
arg1->unkC = arg1->unkC | 0x400000;
}
temp_v0 = phi_s6 + 0x24;
if ((phi_s6->unk24 == 1) && (func_80006018(temp_v0->unk4, temp_v0->unkC, temp_v0->unk10, temp_v0->unk18, 30.0f, 20.0f, temp_f24, temp_f26) == 1)) {
arg1->unkC = arg1->unkC | 0x400000;
}
}
}
phi_s0 = phi_s7;
phi_s1 = 0;
loop_13:
if (phi_s0->unk48 == 1) {
temp_f0_3 = temp_f24 - phi_s0->unk4C;
if ((temp_f0_3 > -100.0) && (temp_f0_3 < 100.0)) {
temp_f0_4 = temp_f26 - phi_s0->unk54;
if (temp_f0_4 > -100.0) {
temp_v0_2 = phi_s0 + 0x48;
if ((temp_f0_4 < 100.0) && (func_80006018(temp_v0_2->unk4, temp_v0_2->unkC, temp_v0_2->unk10, temp_v0_2->unk18, 30.0f, 20.0f, temp_f24, temp_f26) == 1)) {
arg1->unkC = arg1->unkC | 0x400000;
}
}
}
}
temp_s1 = phi_s1 + 0x24;
phi_s0 += 0x24;
phi_s1 = temp_s1;
if (temp_s1 != 0xB4) {
goto loop_13;
}
temp_s7 = phi_s7 + 0x10C;
phi_s6 += 0x10C;
phi_s7 = temp_s7;
} while (temp_s7 != &D_801637B8);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012DC0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ED100;
extern f64 D_800ED108;
extern f32 D_800ED110;
extern f64 D_800ED118;
extern f64 D_800ED120;
extern s32 D_8016359C;
extern ? D_801635A0;
extern u16 D_801637B8;
extern u16 D_801637BC;
extern ? D_801637C0;
void func_80013054(void) {
? *temp_v1;
f32 temp_f8;
f64 temp_f12;
f64 temp_f16;
f64 temp_f18;
f64 temp_f22;
u16 *temp_a0;
u16 temp_t7;
? *phi_v1;
f32 phi_f8;
u16 *phi_v1_2;
u16 *phi_a0;
D_801637B8.unk0 = 0;
D_801637B8.unk2 = 0;
temp_f12 = D_800ED100;
temp_f18 = D_800ED110;
temp_f22 = D_800ED120;
phi_v1 = &D_801635A0;
do {
temp_t7 = phi_v1->unk1C;
temp_f8 = temp_t7;
phi_f8 = temp_f8;
if (temp_t7 < 0) {
phi_f8 = temp_f8 + 4294967296.0f;
}
temp_f16 = phi_f8 / D_8016359C;
if (((temp_f12 - D_800ED108) < temp_f16) && (temp_f16 < ((phi_v1->unk104 * temp_f22) + (temp_f12 + temp_f22)))) {
D_801637B8.unk0 = 1;
}
if (((temp_f18 - D_800ED118) < temp_f16) && (temp_f16 < ((phi_v1->unk104 * temp_f22) + (temp_f18 + temp_f22)))) {
D_801637B8.unk2 = 1;
}
temp_v1 = phi_v1 + 0x10C;
phi_v1 = temp_v1;
} while (temp_v1 < &D_801637B8);
phi_v1_2 = &D_801637B8;
phi_a0 = &D_801637BC;
do {
if (*phi_v1_2 == 1) {
*phi_a0 = *phi_a0 + 1;
} else {
*phi_a0 = 0;
}
temp_a0 = phi_a0 + 2;
phi_v1_2 += 2;
phi_a0 = temp_a0;
} while (temp_a0 != &D_801637C0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80013054.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_800061DC(void *, ?, ?); // extern
extern s16 D_80162FCE;
extern ? D_801631E0;
extern ? D_801634D8;
extern ? D_801637B8;
extern u16 D_801637BC;
extern u16 D_801637BE;
extern ? gPlayers;
void func_800131DC(s32 arg0) {
s16 *sp18;
s16 *temp_v1;
s16 temp_v0_2;
s16 temp_v0_3;
s32 temp_v0;
temp_v0 = arg0 * 2;
temp_v1 = temp_v0 + &D_801634D8;
*temp_v1 = 0;
if ((gCurrentCourseId == 0xB) && ((*(&D_801631E0 + temp_v0) == 0) || (sp18 = temp_v1, (func_800061DC((arg0 * 0xDD8) + 0x14 + &gPlayers, 0x447A0000, 0) != 0)))) {
if ((D_801637B8.unk2 == 1) && (D_801637BE >= 0xF1)) {
temp_v0_2 = D_80162FCE;
if ((temp_v0_2 >= 0xB1) && (temp_v0_2 < 0xB6)) {
*(temp_v0 + &D_801634D8) = 1;
}
}
if ((D_801637B8.unk0 == 1) && (D_801637BC >= 0xF1)) {
temp_v0_3 = D_80162FCE;
if ((temp_v0_3 >= 0x132) && (temp_v0_3 < 0x136)) {
*(temp_v0 + &D_801634D8) = 1;
}
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800131DC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ED128;
extern s16 D_80162EB2;
extern s16 D_801630FC;
extern s32 D_80163598;
extern ? D_801637C0;
extern ? D_801637EC;
void func_800132F4(void) {
? *temp_a1;
void *temp_a2;
s16 phi_v1;
? *phi_a1;
phi_v1 = 0;
phi_a1 = &D_801637C0;
do {
temp_a2 = ((phi_v1 & 0xFFFF) * 4) + D_80163598;
phi_a1->unk4 = temp_a2->unk0;
phi_a1->unk8 = D_80162EB2;
phi_a1->unk1C = phi_v1;
phi_a1->unk1E = -1;
phi_a1->unkC = temp_a2->unk2;
phi_v1 += 0xB4;
if (D_8018EDF3 >= THREE_PLAYERS_SELECTED) {
phi_a1->unk0 = 0;
} else {
phi_a1->unk0 = 1;
}
temp_a1 = phi_a1 + 0x2C;
phi_a1->unk10 = 0.0f;
phi_a1->unk14 = 0.0f;
phi_a1->unk18 = 0.0f;
phi_a1->unk20 = D_800ED128;
phi_a1->unk24 = 0;
phi_a1 = temp_a1;
} while (temp_a1 != &D_801637EC);
D_801630FC = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800132F4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80005FD0(f32 *, f32 *); // extern
? func_80006114(f32 *, void *, s16); // extern
s32 func_800061DC(void *, ?, s32); // extern
? func_8000DBAC(void *, void *, f32); // extern
? func_80075A6C(s32, f32 *, ?); // extern
? func_800C98B8(void *, void *, ?); // extern
extern f64 D_800ED130;
extern f64 D_800ED138;
extern f64 D_800ED140;
extern f64 D_800ED148;
extern f64 D_800ED150;
extern ? D_8015F9B8;
extern s16 D_80162EB0;
extern s16 D_801630FC;
extern s32 D_80163598;
extern s32 D_8016359C;
extern ? D_801637C0;
void func_800133C4(void) {
f32 sp9C;
f32 sp98;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp88;
f32 sp80;
f32 sp7C;
f32 sp78;
f32 *temp_a0;
f32 *temp_a1;
f32 *temp_s4;
f32 temp_f0_3;
f32 temp_f26;
f32 temp_f28;
f32 temp_f30;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f22;
f64 temp_f24;
s16 temp_a1_2;
s32 temp_s3;
s32 temp_v0;
void *temp_s1;
void *temp_s2;
void *temp_v0_2;
void *temp_v0_3;
? *phi_s0;
s32 phi_s3;
s32 phi_v1;
s32 phi_v1_2;
D_801630FC = D_801630FC + 1;
temp_f24 = D_800ED130;
temp_f22 = D_800ED138;
temp_s4 = &sp78;
phi_s0 = &D_801637C0;
phi_s3 = 0;
do {
temp_s2 = phi_s0 + 4;
if (phi_s0->unk0 == 1) {
temp_f26 = phi_s0->unk4;
temp_f28 = phi_s0->unk8;
temp_f30 = phi_s0->unkC;
func_8000DBAC(temp_s2, phi_s0 + 0x1C, phi_s0->unk20);
temp_v0 = func_800061DC(temp_s2, 0x44FA0000, phi_s0->unk28);
phi_s0->unk28 = temp_v0;
if (((D_801630FC % 0xA) == 0) && (temp_v0 != 0)) {
temp_a0 = temp_s4;
sp78 = phi_s0->unk4 - 30.0;
sp7C = phi_s0->unk8 + temp_f22;
sp80 = phi_s0->unkC + temp_f24;
func_80006114(temp_a0, temp_s2, phi_s0->unk24);
func_80075A6C(phi_s3, temp_s4, 0x3F8CCCCD);
sp78 = phi_s0->unk4 + 30.0;
sp7C = phi_s0->unk8 + temp_f22;
sp80 = phi_s0->unkC + temp_f24;
func_80006114(temp_s4, temp_s2, phi_s0->unk24);
func_80075A6C(phi_s3, temp_s4, 0x3F8CCCCD);
}
if (random_int(0x64) == 0) {
temp_s1 = phi_s0 + 0x10;
if (random_int(2) == 0) {
func_800C98B8(temp_s2, temp_s1, 0x19018047);
} else {
func_800C98B8(temp_s2, temp_s1, 0x19018048);
}
}
sp94 = temp_f26;
sp98 = temp_f28;
sp9C = temp_f30;
temp_v0_2 = (((phi_s0->unk1C + 5) % D_8016359C) * 4) + D_80163598;
temp_a1 = &sp88;
sp88 = temp_v0_2->unk0;
sp8C = D_80162EB0;
sp90 = temp_v0_2->unk2;
temp_a1_2 = func_80005FD0(&sp94, temp_a1) - phi_s0->unk24;
phi_v1 = temp_a1_2;
if (temp_a1_2 < 0) {
phi_v1 = temp_a1_2 * -1;
}
phi_v1_2 = phi_v1;
if (phi_v1 >= 0x1771) {
temp_f0 = phi_s0->unk20;
if (D_800ED140 < temp_f0) {
phi_s0->unk20 = temp_f0 - D_800ED148;
}
if (phi_v1 >= 0x3D) {
phi_v1_2 = 0x3C;
}
} else {
temp_f0_2 = phi_s0->unk20;
if (temp_f0_2 < 2.0) {
phi_s0->unk20 = temp_f0_2 + D_800ED150;
}
if (phi_v1 >= 0x1F) {
phi_v1_2 = 0x1E;
}
}
if (temp_a1_2 >= 0x8000) {
phi_s0->unk24 = phi_s0->unk24 - phi_v1_2;
} else if (temp_a1_2 > 0) {
phi_s0->unk24 = phi_s0->unk24 + phi_v1_2;
} else if (temp_a1_2 < -0x7FFF) {
phi_s0->unk24 = phi_s0->unk24 + phi_v1_2;
} else if (temp_a1_2 < 0) {
phi_s0->unk24 = phi_s0->unk24 - phi_v1_2;
}
temp_f0_3 = phi_s0->unk4;
phi_s0->unk10 = temp_f0_3 - temp_f26;
phi_s0->unk14 = phi_s0->unk8 - temp_f28;
phi_s0->unk18 = phi_s0->unkC - temp_f30;
temp_v0_3 = (phi_s0->unk1E * 0x70) + &D_8015F9B8;
temp_v0_3->unk18 = temp_f0_3;
temp_v0_3->unk1C = phi_s0->unk8;
temp_v0_3->unk20 = phi_s0->unkC;
if (gIsMirrorMode != 0) {
temp_v0_3->unk12 = -phi_s0->unk24;
} else {
temp_v0_3->unk12 = phi_s0->unk24;
}
temp_v0_3->unk24 = phi_s0->unk10;
temp_v0_3->unk28 = phi_s0->unk14;
temp_v0_3->unk2C = phi_s0->unk18;
}
temp_s3 = phi_s3 + 1;
phi_s0 += 0x2C;
phi_s3 = temp_s3;
} while (temp_s3 != 1);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800133C4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80006018(f32, f32, s32, s32, f32, f32, f32, f32); // extern
extern f64 D_800ED158;
extern f64 D_800ED160;
extern ? D_801637C0;
extern ? D_801637EC;
void func_80013854(void *arg0) {
f32 sp70;
? *temp_s0;
f32 temp_f12;
f32 temp_f14;
f32 temp_f24;
f32 temp_f26;
f32 temp_f28;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f20;
f64 temp_f22;
s32 temp_v0;
? *phi_s0;
f32 phi_f18;
temp_v0 = arg0->unkBC;
if (((temp_v0 << 7) >= 0) && ((temp_v0 << 6) >= 0)) {
temp_f22 = D_800ED158;
temp_f26 = arg0->unk14;
temp_f28 = arg0->unk1C;
temp_f20 = D_800ED160;
phi_s0 = &D_801637C0;
phi_f18 = arg0->unk18;
do {
if (phi_s0->unk0 == 1) {
temp_f12 = phi_s0->unk4;
temp_f14 = phi_s0->unkC;
temp_f24 = phi_f18 - phi_s0->unk8;
temp_f0 = temp_f26 - temp_f12;
if ((temp_f20 < temp_f0) && (temp_f0 < temp_f22)) {
temp_f0_2 = temp_f28 - temp_f14;
if ((temp_f20 < temp_f0_2) && (temp_f0_2 < temp_f22)) {
sp70 = phi_f18;
if ((func_80006018(temp_f12, temp_f14, phi_s0->unk10, phi_s0->unk18, 200.0f, 60.0f, temp_f26, temp_f28) == 1) && (temp_f24 < 60.0)) {
arg0->unkC = arg0->unkC | 0x80000;
}
}
}
}
temp_s0 = phi_s0 + 0x2C;
phi_s0 = temp_s0;
phi_f18 = phi_f18;
} while (temp_s0 != &D_801637EC);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80013854.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8000D6D0(s32, s32, f32, f32, s32, s32); // extern
s16 func_8000D940(s32, s32, f32, f32, s32); // extern
extern f64 D_800ED168;
extern s16 D_801631C8;
extern s16 D_8016347A;
extern u16 D_801645C8;
void func_800139E4(f32 arg0, f32 arg1, s32 arg2, s32 arg3, void *arg4, s32 arg5) {
s16 temp_v0_2;
s32 temp_hi;
s32 temp_s3;
u16 temp_s7;
void *temp_v0;
s32 phi_s4;
void *phi_s0;
s32 phi_s3;
s32 phi_s1;
s32 phi_s2;
s16 phi_v0;
temp_s7 = D_801645C8;
phi_s3 = 0;
if (arg2 > 0) {
phi_s4 = 0;
phi_s0 = arg4;
phi_s1 = arg4 + 4;
phi_s2 = arg4 + 0x1C;
do {
temp_hi = ((phi_s4 / arg2) + arg3) % temp_s7;
temp_v0 = ((temp_hi & 0xFFFF) * 8) + arg5;
phi_s0->unk4 = temp_v0->unk0;
phi_s0->unk8 = temp_v0->unk2;
phi_s0->unk1E = -1;
phi_s0->unk1C = temp_hi;
phi_s0->unk0 = 0;
phi_s0->unk10 = 0.0f;
phi_s0->unk14 = 0.0f;
phi_s0->unk18 = 0.0f;
phi_s0->unk30 = 0;
phi_s0->unk31 = 0;
phi_s0->unkC = temp_v0->unk4;
if (gModeSelection == TIME_TRIALS) {
phi_s0->unk2E = phi_s3 % 3;
} else {
phi_s0->unk2E = random_int(3);
}
temp_v0_2 = phi_s0->unk2E;
phi_s0->unk24 = (temp_v0_2 - 1) * D_800ED168;
if (((gCCSelection > 0) || (gModeSelection == TIME_TRIALS)) && (temp_v0_2 == 2)) {
phi_s0->unk20 = arg0;
} else {
phi_s0->unk20 = arg1;
}
phi_s0->unk28 = 0;
phi_s0->unk2C = 0;
if (D_8016347A == 0) {
phi_v0 = func_8000D6D0(phi_s1, phi_s2, phi_s0->unk20, phi_s0->unk24, 0, 3);
} else {
phi_v0 = func_8000D940(phi_s1, phi_s2, phi_s0->unk20, phi_s0->unk24, 0);
}
phi_s0->unk2A = phi_v0;
temp_s3 = phi_s3 + 1;
phi_s4 += temp_s7;
phi_s0 += 0x34;
phi_s3 = temp_s3;
phi_s1 += 0x34;
phi_s2 += 0x34;
} while (temp_s3 != arg2);
}
D_801631C8 = 0xA;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800139E4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ED170;
extern f32 D_800ED174;
f32 func_80013C74(s16 arg0, s16 arg1) {
f32 phi_f2;
phi_f2 = 0.0f;
if (arg1 < 0x28A) {
if (arg0 != 0) {
if (arg0 != 1) {
if (arg0 != 2) {
return 0.0f;
}
return D_800ED174;
}
// Duplicate return node #13. Try simplifying control flow for better match
return phi_f2;
}
return D_800ED170;
}
if ((arg0 != 0) && (arg0 != 1)) {
if (arg0 != 2) {
return 0.0f;
}
phi_f2 = 0.5f;
return phi_f2;
}
return -0.5f;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80013C74.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8000D6D0(void *, void *, s32, f32, s32, s32); // extern
s16 func_8000D940(void *, void *, s32, f32, s32); // extern
f32 func_80013C74(s16, s16); // extern
? func_800224F0(void *, s16, ?); // extern
s32 func_802B5224(f32 *, f32 *); // extern
extern f64 D_800ED178;
extern f64 D_800ED180;
extern ? D_8015F9B8;
extern s16 D_8016347A;
void func_80013D20(void *arg0) {
f32 sp5C;
f32 sp58;
f32 sp54;
f32 sp48;
f32 sp44;
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp34;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
void *temp_v1;
f32 phi_f2;
s16 phi_a1;
sp5C = arg0->unk4;
temp_f0 = arg0->unk8;
sp44 = 0.0f;
sp48 = 0.0f;
sp40 = temp_f0;
sp54 = arg0->unkC;
sp58 = temp_f0;
temp_f0_2 = func_80013C74(arg0->unk2E, arg0->unk1C);
temp_f2 = arg0->unk24;
if (temp_f2 < temp_f0_2) {
arg0->unk24 = temp_f2 + D_800ED178;
if (temp_f0_2 < arg0->unk24) {
arg0->unk24 = temp_f0_2;
}
}
phi_f2 = arg0->unk24;
if (temp_f0_2 < arg0->unk24) {
arg0->unk24 = arg0->unk24 - D_800ED180;
temp_f2_2 = arg0->unk24;
phi_f2 = temp_f2_2;
if (temp_f2_2 < temp_f0_2) {
arg0->unk24 = temp_f0_2;
phi_f2 = arg0->unk24;
}
}
if (D_8016347A == 0) {
phi_a1 = func_8000D6D0(arg0 + 4, arg0 + 0x1C, arg0->unk20, phi_f2, 0, 3);
} else {
phi_a1 = func_8000D940(arg0 + 4, arg0 + 0x1C, arg0->unk20, phi_f2, 0);
}
func_800224F0(arg0 + 0x2A, phi_a1, 0x64);
temp_f0_3 = arg0->unk4 - sp5C;
temp_f2_3 = arg0->unkC - sp54;
sp34 = arg0->unk8;
sp38 = 0.0f;
sp3C = sqrtf((temp_f0_3 * temp_f0_3) + (temp_f2_3 * temp_f2_3));
func_800224F0(arg0 + 0x28, func_802B5224(&sp40, &sp34) * -1, 0x64);
temp_f0_4 = arg0->unk4;
arg0->unk10 = temp_f0_4 - sp5C;
temp_v1 = (arg0->unk1E * 0x70) + &D_8015F9B8;
arg0->unk14 = arg0->unk8 - sp58;
arg0->unk18 = arg0->unkC - sp54;
temp_v1->unk18 = temp_f0_4;
temp_v1->unk1C = arg0->unk8;
temp_v1->unk20 = arg0->unkC;
temp_v1->unk10 = arg0->unk28;
if (gIsMirrorMode != 0) {
temp_v1->unk12 = -arg0->unk2A;
} else {
temp_v1->unk12 = arg0->unk2A;
}
temp_v1->unk14 = arg0->unk2C;
temp_v1->unk24 = arg0->unk10;
temp_v1->unk28 = arg0->unk14;
temp_v1->unk2C = arg0->unk18;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80013D20.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80006018(f32, f32, s32, s32, f32, f32, f32, f32); // extern
s32 func_80007BF8(u16, u16, ?, ?, s32); // extern
? func_800C98B8(void *, void *, s32); // extern
? func_800C9D80(void *, void *, s32); // extern
? func_800C9EF4(void *, s32); // extern
extern f64 D_800ED188;
extern f64 D_800ED190;
extern f64 D_800ED198;
extern f64 D_800ED1A0;
extern s16 D_801631C8;
extern ? D_801631E0;
extern ? D_80163270;
extern s16 D_8016347A;
extern ? D_80164438;
extern u16 D_801645C8;
void func_80013F7C(s32 arg0, void *arg1, void *arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) {
f32 spC4;
f32 spC0;
f32 spBC;
s32 spA8;
u16 *sp9C;
void *sp84;
f32 temp_f12;
f32 temp_f14;
f32 temp_f22;
f32 temp_f24;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f0_3;
f64 temp_f0_4;
f64 temp_f0_5;
f64 temp_f0_6;
f64 temp_f20;
s16 temp_v0_3;
s16 temp_v1;
s32 temp_fp;
s32 temp_s2;
s32 temp_s7;
s32 temp_v0_6;
s8 temp_v0_4;
s8 temp_v0_7;
u16 temp_v0;
u16 temp_v0_2;
u16 temp_v0_5;
u16 temp_v1_2;
u16 temp_v1_3;
void *phi_s0;
s32 phi_s1;
s32 phi_a2;
s32 phi_fp;
temp_s7 = arg0 * 2;
phi_s0 = arg2;
if (((*(&D_801631E0 + temp_s7) != 1) || ((temp_v0 = arg1->unk0, ((temp_v0 & 0x4000) != 0)) && ((temp_v0 & 0x1000) == 0))) && ((arg1->unkBC << 7) >= 0)) {
spC4 = arg1->unk14;
spC0 = arg1->unk18;
spBC = arg1->unk1C;
phi_fp = 0;
if (arg5 > 0) {
do {
temp_f12 = phi_s0->unk4;
temp_f14 = phi_s0->unkC;
temp_f20 = spC4 - temp_f12;
temp_f22 = spC0 - phi_s0->unk8;
temp_f24 = spBC - temp_f14;
if ((temp_f20 > -100.0) && (temp_f20 < 100.0)) {
temp_f0 = temp_f22;
if ((temp_f0 > -20.0) && (temp_f0 < 20.0)) {
temp_f0_2 = temp_f24;
if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0) && (func_80006018(temp_f12, temp_f14, phi_s0->unk10, phi_s0->unk18, arg3, arg4, spC4, spBC) == 1)) {
arg1->unkC = arg1->unkC | 0x400000;
}
}
}
temp_v0_2 = arg1->unk0;
if (((temp_v0_2 & 0x4000) != 0) && ((temp_v0_2 & 0x1000) == 0)) {
temp_s2 = 1 << arg0;
if ((D_800ED188 < temp_f20) && (temp_f20 < D_800ED190) && (temp_f0_3 = temp_f22, (temp_f0_3 > -20.0)) && (temp_f0_3 < 20.0) && (temp_f0_4 = temp_f24, (D_800ED198 < temp_f0_4)) && (temp_f0_4 < D_800ED1A0)) {
temp_v0_3 = D_801631C8;
if ((temp_v0_3 > 0) && (phi_s0->unk30 == 0)) {
D_801631C8 = temp_v0_3 - 1;
phi_s0->unk30 = phi_s0->unk30 | temp_s2;
func_800C9D80(phi_s0 + 4, phi_s0 + 0x10, arg6);
}
} else {
temp_v0_4 = phi_s0->unk30;
if (temp_v0_4 != 0) {
phi_s0->unk30 = temp_v0_4 & ~temp_s2;
if (phi_s0->unk30 == 0) {
D_801631C8 = D_801631C8 + 1;
func_800C9EF4(phi_s0 + 4, arg6);
}
}
}
if ((temp_f20 > -200.0) && (temp_f20 < 200.0) && (temp_f0_5 = temp_f22, (temp_f0_5 > -20.0)) && (temp_f0_5 < 20.0) && (temp_f0_6 = temp_f24, (temp_f0_6 > -200.0)) && (temp_f0_6 < 200.0)) {
if ((phi_s0->unk31 & temp_s2) == 0) {
temp_v1 = D_8016347A;
temp_v0_5 = D_801645C8;
phi_s1 = 0;
phi_s1 = 0;
phi_s1 = 0;
if (temp_v1 != 0) {
if (temp_v1 != 1) {
} else if (func_80007BF8(phi_s0->unk1C, *(&D_80164438 + temp_s7), 0, 0xA, temp_v0_5) > 0) {
if (random_int(2) == 0) {
temp_v1_2 = *(&D_80163270 + temp_s7);
if (temp_v1_2 == 0) {
phi_s1 = 1;
}
if ((temp_v1_2 == 1) && (arg1->unk94 < phi_s0->unk20)) {
phi_s1 = 1;
}
} else {
phi_s0->unk31 = phi_s0->unk31 | temp_s2;
}
}
} else {
sp9C = temp_s7 + &D_80163270;
temp_v0_6 = func_80007BF8(phi_s0->unk1C, *(&D_80164438 + temp_s7), 0xA, 0, temp_v0_5);
temp_v1_3 = *sp9C;
if ((temp_v1_3 == 0) && (temp_v0_6 > 0) && (arg1->unk94 < phi_s0->unk20)) {
phi_s1 = 1;
}
if ((temp_v1_3 == 1) && (temp_v0_6 > 0)) {
phi_s1 = 1;
}
}
if (phi_s1 == 1) {
sp84 = phi_s0 + 0x10;
phi_a2 = 0x1901703B;
phi_a2 = 0x1901703B;
if (arg6 != 0x51018002) {
if (arg6 != 0x51018003) {
if (arg6 != 0x51018004) {
if (arg6 != 0x51018005) {
} else {
spA8 = 0x1901703B;
if (random_int(4) == 0) {
phi_a2 = 0x1901703C;
}
}
} else if (random_int(2) != 0) {
phi_a2 = 0x19017041;
} else {
phi_a2 = 0x19017042;
}
} else if (random_int(2) != 0) {
phi_a2 = 0x1901703F;
} else {
phi_a2 = 0x19017040;
}
} else if (random_int(2) != 0) {
phi_a2 = 0x1901703D;
} else {
phi_a2 = 0x1901703E;
}
phi_s0->unk31 = phi_s0->unk31 | temp_s2;
func_800C98B8(phi_s0 + 4, sp84, phi_a2);
}
}
} else {
temp_v0_7 = phi_s0->unk31;
if ((temp_v0_7 & temp_s2) != 0) {
phi_s0->unk31 = temp_v0_7 & ~temp_s2;
}
}
}
temp_fp = phi_fp + 1;
phi_s0 += 0x34;
phi_fp = temp_fp;
} while (temp_fp != arg5);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80013F7C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ED1A8;
extern f32 D_800ED1AC;
f32 func_800145A8(s16 arg0, f32 arg1, s16 arg2) {
f32 phi_f12;
phi_f12 = arg1;
if (arg2 < 0x28A) {
if (arg0 != 0) {
if (arg0 != 1) {
if (arg0 != 2) {
return arg1;
}
if (arg1 >= 0.0) {
return 0.0f;
}
// Duplicate return node #18. Try simplifying control flow for better match
return phi_f12;
}
if (arg1 < 0.0) {
return D_800ED1A8;
}
return D_800ED1AC;
}
if (arg1 < 0.0) {
return 0.0f;
}
// Duplicate return node #18. Try simplifying control flow for better match
return phi_f12;
}
if ((arg0 != 0) && (arg0 != 1)) {
if (arg0 != 2) {
return arg1;
}
phi_f12 = -0.5f;
return phi_f12;
}
return 0.5f;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800145A8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 func_800145A8(s16, s32, s16, u16); // extern
extern f64 D_800ED1B0;
extern s16 D_80162FCE;
extern ? D_80163068;
extern ? D_801634FC;
extern u16 D_801645C8;
extern ? gPlayers;
void func_800146B8(s32 arg0, s32 arg1, void *arg2) {
s32 temp_a2;
s32 temp_v0;
u16 temp_a1;
void *phi_s0;
s32 phi_v1;
s32 phi_v0;
s32 phi_a2;
phi_s0 = arg2;
if (!(*(&gPlayers + 0x94 + (arg0 * 0xDD8)) < D_800ED1B0) && (phi_a2 = 0, (arg1 > 0))) {
loop_3:
temp_a1 = phi_s0->unk1C;
phi_v1 = D_80162FCE;
phi_v0 = 0;
loop_4:
temp_v0 = phi_v0 + 3;
phi_v0 = temp_v0;
if (temp_a1 == (phi_v1 % D_801645C8)) {
*(&D_801634FC + (arg0 * 0x10)) = func_800145A8(phi_s0->unk2E, *(&D_80163068 + (arg0 * 4)), temp_a1, temp_a1);
return;
}
phi_v1 += 3;
if (temp_v0 == 0x18) {
temp_a2 = phi_a2 + 1;
phi_s0 += 0x34;
phi_a2 = temp_a2;
if (temp_a2 == arg1) {
// Duplicate return node #8. Try simplifying control flow for better match
return;
}
goto loop_3;
}
goto loop_4;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800146B8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800139E4(f32, f32, ?, ?, ? *, s16 *); // extern
extern f64 D_800ED1B8;
extern f64 D_800ED1C0;
extern f64 D_800ED1C8;
extern ? D_80163818;
void func_800147E0(void) {
f64 temp_f0;
? phi_a2;
temp_f0 = (gCCSelection * D_800ED1B8) / 216.0;
phi_a2 = 7;
if (gModeSelection == TIME_TRIALS) {
phi_a2 = 8;
}
func_800139E4(temp_f0 + D_800ED1C0, temp_f0 + D_800ED1C8, phi_a2, 0, &D_80163818, D_80164550);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800147E0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013D20(? *); // extern
extern ? D_80163818;
extern ? D_80163984;
void func_8001487C(void) {
? *temp_s0;
? *phi_s0;
phi_s0 = &D_80163818;
do {
func_80013D20(phi_s0);
temp_s0 = phi_s0 + 0x34;
phi_s0 = temp_s0;
} while (temp_s0 != &D_80163984);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001487C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013F7C(? *, ?, f32, s32, s32); // extern
extern ? D_80163818;
void func_800148C4(void) {
func_80013F7C(&D_80163818, 0x425C0000, 12.5f, 7, 0x51018003);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800148C4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800146B8(?, ? *); // extern
extern ? D_80163818;
void func_8001490C(void) {
func_800146B8(7, &D_80163818);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001490C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800139E4(f32, f32, ?, ?, ? *, s16 *); // extern
extern f64 D_800ED1D0;
extern f64 D_800ED1D8;
extern f64 D_800ED1E0;
extern ? D_80163988;
void func_80014934(void) {
f64 temp_f0;
? phi_a2;
temp_f0 = (gCCSelection * D_800ED1D0) / 216.0;
phi_a2 = 7;
if (gModeSelection == TIME_TRIALS) {
phi_a2 = 8;
}
func_800139E4(temp_f0 + D_800ED1D8, temp_f0 + D_800ED1E0, phi_a2, 0x4B, &D_80163988, D_80164550);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014934.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013D20(? *); // extern
extern ? D_80163988;
extern ? D_80163AF4;
void func_800149D0(void) {
? *temp_s0;
? *phi_s0;
phi_s0 = &D_80163988;
do {
func_80013D20(phi_s0);
temp_s0 = phi_s0 + 0x34;
phi_s0 = temp_s0;
} while (temp_s0 != &D_80163AF4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800149D0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013F7C(? *, ?, f32, s32, s32); // extern
extern ? D_80163988;
void func_80014A18(void) {
func_80013F7C(&D_80163988, 0x428C0000, 12.5f, 7, 0x51018002);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014A18.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800146B8(?, ? *); // extern
extern ? D_80163988;
void func_80014A60(void) {
func_800146B8(7, &D_80163988);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014A60.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800139E4(f32, f32, ?, ?, ? *, s16 *); // extern
extern f64 D_800ED1E8;
extern f64 D_800ED1F0;
extern f64 D_800ED1F8;
extern ? D_80163AF8;
void func_80014A88(void) {
f64 temp_f0;
? phi_a2;
temp_f0 = (gCCSelection * D_800ED1E8) / 216.0;
phi_a2 = 7;
if (gModeSelection == TIME_TRIALS) {
phi_a2 = 8;
}
func_800139E4(temp_f0 + D_800ED1F0, temp_f0 + D_800ED1F8, phi_a2, 0x32, &D_80163AF8, D_80164550);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014A88.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013D20(? *); // extern
extern ? D_80163AF8;
extern ? D_80163C64;
void func_80014B24(void) {
? *temp_s0;
? *phi_s0;
phi_s0 = &D_80163AF8;
do {
func_80013D20(phi_s0);
temp_s0 = phi_s0 + 0x34;
phi_s0 = temp_s0;
} while (temp_s0 != &D_80163C64);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014B24.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013F7C(? *, ?, f32, s32, s32); // extern
extern ? D_80163AF8;
void func_80014B6C(void) {
func_80013F7C(&D_80163AF8, 0x425C0000, 12.5f, 7, 0x51018004);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014B6C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800146B8(?, ? *); // extern
extern ? D_80163AF8;
void func_80014BB4(void) {
func_800146B8(7, &D_80163AF8);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014BB4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800139E4(f32, f32, ?, ?, ? *, s16 *); // extern
extern f64 D_800ED200;
extern f64 D_800ED208;
extern f64 D_800ED210;
extern ? D_80163C68;
void func_80014BDC(void) {
f64 temp_f0;
? phi_a2;
temp_f0 = (gCCSelection * D_800ED200) / 216.0;
phi_a2 = 7;
if (gModeSelection == TIME_TRIALS) {
phi_a2 = 8;
}
func_800139E4(temp_f0 + D_800ED208, temp_f0 + D_800ED210, phi_a2, 0x19, &D_80163C68, D_80164550);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014BDC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013D20(? *); // extern
extern ? D_80163C68;
extern ? D_80163DD4;
void func_80014C78(void) {
? *temp_s0;
? *phi_s0;
phi_s0 = &D_80163C68;
do {
func_80013D20(phi_s0);
temp_s0 = phi_s0 + 0x34;
phi_s0 = temp_s0;
} while (temp_s0 != &D_80163DD4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014C78.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80013F7C(? *, ?, f32, s32, s32); // extern
extern ? D_80163C68;
void func_80014CC0(void) {
func_80013F7C(&D_80163C68, 0x41380000, 8.5f, 7, 0x51018005);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014CC0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800146B8(?, ? *); // extern
extern ? D_80163C68;
void func_80014D08(void) {
func_800146B8(7, &D_80163C68);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014D08.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802ADDC8(void *, ?, f32, f32, f32); // extern
extern ? D_80164668;
extern ? cameras;
void func_80014D30(s32 arg0, s32 arg1) {
void *temp_v0;
temp_v0 = (&D_80164550)[arg1] + (*(&D_80164668 + (arg0 * 2)) * 8);
func_802ADDC8((arg0 * 0xB8) + 0x54 + &cameras, 0x41200000, temp_v0->unk0, temp_v0->unk2 + 30.0f, temp_v0->unk4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014D30.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_80163238;
extern s16 D_80164668;
extern ? D_80164670;
extern ? D_80164678;
extern ? D_80164680;
extern ? D_801646C0;
extern s32 D_801646C8;
extern s16 D_801646CC;
extern ? D_801646D0;
extern s8 D_8018EDFC;
void func_80014DE4(s32 arg0) {
s16 *temp_v1;
s16 temp_a2;
s32 temp_a1;
s32 temp_v0;
void *temp_a2_2;
temp_v0 = arg0 * 2;
D_801646CC = 0;
temp_v1 = temp_v0 + &D_80164678;
*temp_v1 = *(&D_80164670 + temp_v0);
temp_a1 = gModeSelection;
if ((temp_a1 != TIME_TRIALS) && ((gCupCourseSelection == CUP_COURSE_ONE) || (D_800DC51C == 1))) {
goto block_8;
}
temp_a2 = *temp_v1;
if ((temp_a2 != 0) && (temp_a2 != 1) && (temp_a2 != 2) && (temp_a2 != 3)) {
block_8:
*temp_v1 = 0;
}
*(&D_80164680 + temp_v0) = -1;
D_80163238 = 0;
*(&D_801646C0 + temp_v0) = 0;
D_801646C8 = 0;
temp_a2_2 = (arg0 * 8) + &D_801646D0;
temp_a2_2->unk0 = 0;
temp_a2_2->unk2 = 0;
temp_a2_2->unk4 = 0;
if ((temp_a1 == TIME_TRIALS) && (D_8018EDFC == 0)) {
*temp_v1 = 0;
}
D_80164668 = 0;
D_80164668 = 0;
D_80164668 = 0;
D_80164668 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014DE4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_80164498;
extern ? D_80164678;
f32 func_80014EE4(f32 arg0, s32 arg1) {
f32 temp_f0;
f32 temp_f12;
f32 temp_f12_10;
f32 temp_f12_11;
f32 temp_f12_12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f12_4;
f32 temp_f12_5;
f32 temp_f12_6;
f32 temp_f12_7;
f32 temp_f12_8;
f32 temp_f12_9;
f64 temp_f14;
f64 temp_f14_2;
f64 temp_f14_3;
f64 temp_f14_4;
f64 temp_f14_5;
f64 temp_f14_6;
f64 temp_f14_7;
f64 temp_f14_8;
f64 temp_f2;
f64 temp_f2_2;
f64 temp_f2_3;
f64 temp_f2_4;
s16 temp_v0;
f64 phi_f14;
f64 phi_f14_2;
f64 phi_f14_3;
f64 phi_f14_4;
f32 phi_f12;
temp_v0 = *(&D_80164678 + (arg1 * 2));
temp_f0 = *(&D_80164498 + (arg1 * 4));
phi_f12 = arg0;
phi_f12 = arg0;
phi_f12 = arg0;
phi_f12 = arg0;
if (temp_v0 != 0) {
if (temp_v0 != 1) {
if (temp_v0 != 2) {
if (temp_v0 != 3) {
return 40.0f;
}
temp_f14 = arg0;
temp_f2_3 = 60.0 + temp_f0;
phi_f14 = temp_f14;
if (temp_f14 < temp_f2_3) {
temp_f12 = temp_f14 + 0.5;
temp_f14_2 = temp_f12;
phi_f14 = temp_f14_2;
phi_f12 = temp_f12;
if (temp_f2_3 < temp_f14_2) {
temp_f12_2 = temp_f2_3;
phi_f14 = temp_f12_2;
phi_f12 = temp_f12_2;
}
}
if ((temp_f2_3 < phi_f14) && (temp_f12_3 = phi_f14 - 0.5, phi_f12 = temp_f12_3, (temp_f12_3 < temp_f2_3))) {
return temp_f2_3;
}
// Duplicate return node #29. Try simplifying control flow for better match
return phi_f12;
}
temp_f14_3 = arg0;
temp_f2_4 = 60.0 + temp_f0;
phi_f14_2 = temp_f14_3;
if (temp_f14_3 < temp_f2_4) {
temp_f12_4 = temp_f14_3 + 1.0;
temp_f14_4 = temp_f12_4;
phi_f14_2 = temp_f14_4;
phi_f12 = temp_f12_4;
if (temp_f2_4 < temp_f14_4) {
temp_f12_5 = temp_f2_4;
phi_f14_2 = temp_f12_5;
phi_f12 = temp_f12_5;
}
}
if (temp_f2_4 < phi_f14_2) {
temp_f12_6 = phi_f14_2 - 1.0;
phi_f12 = temp_f12_6;
if (temp_f12_6 < temp_f2_4) {
phi_f12 = temp_f2_4;
}
}
// Duplicate return node #29. Try simplifying control flow for better match
return phi_f12;
}
temp_f14_5 = arg0;
temp_f2_2 = 60.0 + temp_f0;
phi_f14_3 = temp_f14_5;
if (temp_f14_5 < temp_f2_2) {
temp_f12_7 = temp_f14_5 + 1.0;
temp_f14_6 = temp_f12_7;
phi_f14_3 = temp_f14_6;
phi_f12 = temp_f12_7;
if (temp_f2_2 < temp_f14_6) {
temp_f12_8 = temp_f2_2;
phi_f14_3 = temp_f12_8;
phi_f12 = temp_f12_8;
}
}
if ((temp_f2_2 < phi_f14_3) && (temp_f12_9 = phi_f14_3 - 1.0, phi_f12 = temp_f12_9, (temp_f12_9 < temp_f2_2))) {
return temp_f2_2;
}
// Duplicate return node #29. Try simplifying control flow for better match
return phi_f12;
}
temp_f14_7 = arg0;
temp_f2 = 40.0 + temp_f0;
phi_f14_4 = temp_f14_7;
if (temp_f2 < temp_f14_7) {
temp_f12_10 = temp_f14_7 - 1.0;
temp_f14_8 = temp_f12_10;
phi_f14_4 = temp_f14_8;
phi_f12 = temp_f12_10;
if (temp_f14_8 < temp_f2) {
temp_f12_11 = temp_f2;
phi_f14_4 = temp_f12_11;
phi_f12 = temp_f12_11;
}
}
if ((phi_f14_4 < temp_f2) && (temp_f12_12 = phi_f14_4 + 1.0, phi_f12 = temp_f12_12, (temp_f2 < temp_f12_12))) {
return temp_f2;
}
return phi_f12;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014EE4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 sins(s32); // extern
f32 coss(s32); // extern
extern ? D_801646C0;
void func_800151A4(void *arg0, s32 arg1) {
f32 sp44;
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp34;
f32 sp30;
f32 sp28;
f32 sp20;
f32 temp_f0;
f32 temp_f10;
f32 temp_f14;
f32 temp_f16;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f8;
u16 temp_s1;
temp_s1 = *(&D_801646C0 + (arg1 * 2));
if (temp_s1 == 0) {
arg0->unk18 = 0.0f;
arg0->unk20 = 0.0f;
arg0->unk1C = 1.0f;
return;
}
temp_f2 = arg0->unkC - arg0->unk0;
temp_f14 = arg0->unk10 - arg0->unk4;
sp38 = temp_f2;
temp_f16 = arg0->unk14 - arg0->unk8;
sp34 = temp_f14;
sp30 = temp_f16;
temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16));
temp_f8 = temp_f14 / temp_f0;
sp44 = temp_f2 / temp_f0;
temp_f10 = temp_f16 / temp_f0;
sp40 = temp_f8;
sp3C = temp_f10;
sp28 = 1.0 - coss(temp_s1 & 0xFFFF);
arg0->unk18 = (sp28 * sp44 * sp40) - (sins(temp_s1 & 0xFFFF) * temp_f10);
temp_f2_2 = sp28 * sp40;
arg0->unk1C = coss(temp_s1 & 0xFFFF) + (temp_f2_2 * sp40);
sp20 = temp_f2_2;
arg0->unk20 = (sins(temp_s1 & 0xFFFF) * sp44) + (temp_f2_2 * temp_f10);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800151A4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80015390(void *, Player *, ?, s32); // extern
void func_80015314(s32 arg0, ? arg1, s32 arg2) {
Player *temp_a1;
void *temp_a0;
temp_a1 = &gPlayerOne[arg0];
temp_a0 = camera1 + (arg2 * 0xB8);
temp_a0->unk2C = temp_a1->unk_02E;
func_80015390(temp_a0, temp_a1, 0, arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015314.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8001D794(Player *, void *, f32 *, f32 *, f32 *, f32 *, s32); // extern
? func_800224F0(void *, s16, s16); // extern
? func_802ADDC8(void *, ?, f32, f32, f32); // extern
s16 func_802B7830(f32, f32); // extern
void func_80015390(void *arg0, ? arg1, ? arg2) {
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp84;
f32 sp80;
f32 sp7C;
f32 sp64;
Player *temp_s1;
f32 temp_f12;
f32 temp_f14;
s16 temp_v0;
s32 temp_v0_2;
s16 phi_a2;
temp_s1 = &gPlayerOne[arg0->unkAE];
temp_v0 = temp_s1->unk_078;
if (temp_v0 == 0) {
phi_a2 = 0x64;
} else if (temp_v0 < 0) {
phi_a2 = 0xA0 - (temp_v0 / 0x10);
} else {
phi_a2 = (temp_v0 / 0x10) + 0xA0;
}
temp_v0_2 = temp_s1->unk_0BC;
if (((temp_v0_2 & 0x80) == 0) && ((temp_v0_2 & 0x40) == 0)) {
func_800224F0(arg0 + 0x2C, temp_s1->unk_02E, phi_a2);
}
func_8001D794(temp_s1, arg0, &sp64, &sp84, &sp80, &sp7C, arg0->unk2C);
func_802ADDC8(arg0 + 0x54, 0x41200000, sp84, sp80, sp7C);
arg0->unkC = sp64;
arg0->unk10 = sp68;
arg0->unk14 = sp6C;
arg0->unk0 = sp84;
arg0->unk4 = sp80;
temp_f12 = arg0->unkC - arg0->unk0;
arg0->unk8 = sp7C;
sp90 = arg0->unk10 - arg0->unk4;
sp94 = temp_f12;
temp_f14 = arg0->unk14 - arg0->unk8;
sp8C = temp_f14;
arg0->unk26 = func_802B7830(temp_f12, temp_f14);
arg0->unk24 = func_802B7830(sqrtf((sp94 * sp94) + (temp_f14 * temp_f14)), sp90);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015390.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(f32, s32, f32, s16); // extern
extern f64 D_800ED218;
extern ? D_80162FA0;
extern ? D_80164438;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
void func_80015544(s32 arg0, f32 arg1, s32 arg2, s16 arg3) {
s32 sp2C;
s16 *sp28;
f32 *sp24;
f32 *sp20;
f64 sp18;
f32 *temp_a0;
f32 *temp_a1;
f32 *temp_v1_2;
f32 *temp_v1_3;
f32 temp_f0;
f32 temp_f12;
f64 temp_f12_2;
f64 temp_f2;
s16 *temp_v1;
s32 temp_hi;
s32 temp_t7;
void *temp_v0;
f32 *phi_v1;
temp_t7 = arg2 * 4;
temp_hi = (*(&D_80164438 + (arg0 * 2)) + 0xA) % *(&D_801645C8 + (arg3 * 2));
*(&D_80164688 + temp_t7) = arg1;
temp_v1 = (arg2 * 2) + &D_80164668;
*temp_v1 = temp_hi;
sp28 = temp_v1;
sp2C = temp_t7;
func_8000BBD8(arg1, temp_hi & 0xFFFF, arg1, arg3);
temp_f12 = D_80162FA0.unk0;
temp_f0 = D_80162FA0.unk8;
temp_a0 = temp_t7 + &D_801645F8;
temp_a1 = temp_t7 + &D_80164638;
*temp_a0 = temp_f12;
*temp_a1 = temp_f0;
sp20 = temp_a1;
sp24 = temp_a0;
temp_f2 = ((&D_80164550)[arg3] + (*temp_v1 * 8))->unk2;
sp18 = temp_f2;
temp_f12_2 = func_802AE1C0(temp_f12, temp_f2 + 30.0, temp_f0);
if ((temp_f12_2 < (temp_f2 - 20.0)) || (D_800ED218 <= temp_f12_2)) {
temp_v1_3 = temp_t7 + &D_80164618;
*temp_v1_3 = temp_f2 + 10.0;
phi_v1 = temp_v1_3;
} else {
temp_v1_2 = temp_t7 + &D_80164618;
*temp_v1_2 = temp_f12_2 + 10.0;
phi_v1 = temp_v1_2;
}
*(&D_80164648 + temp_t7) = 0.0f;
temp_v0 = (arg2 * 0xB8) + &cameras;
temp_v0->unk0 = *temp_a0;
temp_v0->unk4 = *phi_v1;
temp_v0->unk8 = *temp_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015544.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80007BF8(s32, s32, ?, ?, s32); // extern
s16 func_8000D33C(f32, f32, u16, f32, s16, s32); // extern
? func_80014D30(s32, s32); // extern
? func_8001A348(s32, s32, s16); // extern
s16 func_802B7830(f32, f32); // extern
extern f64 D_800ED220;
extern f64 D_800ED228;
extern ? D_80163068;
extern ? D_80164438;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
void func_8001577C(void *arg0, ? arg1, ? arg2, s32 arg3) {
s16 sp8E;
s16 sp8C;
f32 sp84;
f32 sp80;
f32 sp7C;
s32 sp74;
s32 sp44;
s32 sp3C;
s32 sp38;
s16 *sp34;
Player *temp_s2;
f32 temp_f12;
f32 temp_f14;
f64 temp_f0;
s16 *temp_t0;
s16 temp_t2;
s16 temp_t3;
s16 temp_v1;
s32 temp_t1;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s32 temp_v1_2;
s32 temp_v1_3;
s32 temp_v1_4;
u16 temp_a1;
s32 phi_v1;
temp_v1 = arg0->unkAE;
temp_t1 = temp_v1 * 2;
temp_a1 = *(&D_801645B0 + temp_t1);
temp_v0 = arg3 * 2;
temp_t0 = temp_v0 + &D_80164668;
sp34 = temp_t0;
sp38 = temp_v0;
sp3C = temp_t1;
sp74 = temp_v1;
sp44 = temp_a1;
temp_s2 = &gPlayerOne[temp_v1];
*temp_t0 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, *temp_t0, temp_a1);
temp_t2 = *(&D_80164438 + temp_t1);
temp_t3 = *temp_t0;
sp8C = temp_t2;
sp8E = temp_t3;
if (func_80007BF8(temp_t2 & 0xFFFF, temp_t3 & 0xFFFF, 0x32, 0xF, *(&D_801645C8 + (sp44 * 2))) <= 0) {
temp_v1_2 = arg3 * 4;
sp3C = temp_v1_2;
func_8001A348(arg3, *(&D_80164680 + temp_v1_2), *(&D_80164688 + sp38));
goto block_10;
}
temp_f0 = *(&D_80163068 + (temp_v1 * 4));
temp_v1_3 = arg3 * 4;
if ((temp_f0 < D_800ED220) && (temp_v0_2 = temp_t2 - temp_t3, (*(&D_80164688 + temp_v1_3) < -0.5)) && ((temp_v0_2 * temp_v0_2) < 5)) {
sp3C = temp_v1_3;
func_8001A348(arg3, 0x3F800000, 3);
goto block_10;
}
temp_v1_4 = arg3 * 4;
phi_v1 = temp_v1_4;
if (D_800ED228 < temp_f0) {
temp_v0_3 = temp_t2 - temp_t3;
if ((*(&D_80164688 + temp_v1_4) > 0.5) && ((temp_v0_3 * temp_v0_3) < 5)) {
sp3C = temp_v1_4;
func_8001A348(arg3, 0xBF800000, 2);
block_10:
phi_v1 = sp3C;
}
}
arg0->unk0 = *(&D_801645F8 + phi_v1);
arg0->unk4 = *(&D_80164618 + phi_v1);
arg0->unk8 = *(&D_80164638 + phi_v1);
arg0->unkC = temp_s2->posX;
arg0->unk10 = temp_s2->posY + 6.0;
arg0->unk14 = temp_s2->posZ;
func_80014D30(arg3, sp44);
temp_f12 = arg0->unkC - arg0->unk0;
sp80 = arg0->unk10 - arg0->unk4;
sp84 = temp_f12;
temp_f14 = arg0->unk14 - arg0->unk8;
sp7C = temp_f14;
arg0->unk26 = func_802B7830(temp_f12, temp_f14);
arg0->unk24 = func_802B7830(sqrtf((sp84 * sp84) + (temp_f14 * temp_f14)), sp80);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001577C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(f32, s32, f32, s16, s16); // extern
extern ? D_80162FA0;
extern ? D_80164438;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
extern ? gPlayers;
void func_80015A9C(s32 arg0, f32 arg1, s32 arg2, s16 arg3) {
s32 sp20;
s16 *sp1C;
f32 *temp_a0;
f32 *temp_a1;
f32 *temp_a2_2;
f32 *temp_t0;
f32 temp_f0;
s16 *temp_v1;
s16 temp_a2;
s16 temp_a3;
s32 temp_t3;
s32 temp_t8;
void *temp_v0;
temp_a3 = arg3;
temp_t8 = arg2 * 4;
temp_v1 = (arg2 * 2) + &D_80164668;
*(&D_80164688 + temp_t8) = arg1;
*temp_v1 = *(&D_80164438 + (arg0 * 2)) + 0xA;
temp_t3 = *temp_v1 % *(&D_801645C8 + (temp_a3 * 2));
*temp_v1 = temp_t3;
temp_a2 = temp_a3;
sp20 = temp_t8;
sp1C = temp_v1;
arg3 = temp_a3;
func_8000BBD8(arg1, temp_t3 & 0xFFFF, arg1, temp_a2, temp_a3);
temp_a0 = temp_t8 + &D_801645F8;
*temp_a0 = D_80162FA0.unk0;
temp_a1 = temp_t8 + &D_80164618;
temp_a2_2 = temp_t8 + &D_80164638;
*temp_a1 = ((&D_80164550)[arg3] + (*temp_v1 * 8))->unk2;
*temp_a2_2 = D_80162FA0.unk8;
temp_f0 = *(&gPlayers + 0x94 + (arg0 * 0xDD8)) / 5.0f;
temp_t0 = temp_t8 + &D_80164648;
*temp_t0 = temp_f0;
if (temp_f0 < 0.0) {
*temp_t0 = 0.0f;
}
temp_v0 = (arg2 * 0xB8) + &cameras;
temp_v0->unk0 = *temp_a0;
temp_v0->unk4 = *temp_a1;
temp_v0->unk8 = *temp_a2_2;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015A9C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80007BF8(s32, s32, ?, ?, s32); // extern
? func_8000BBD8(u16, s32, u16, s16, s32 *); // extern
s16 func_8000D33C(f32, f32, s16 *, f32, s16, s32); // extern
? func_80014D30(s32, s32); // extern
? func_8001A348(s32, s32, s16, s32 *, s32 *); // extern
s16 func_802B7830(f32, f32); // extern
extern f64 D_800ED230;
extern ? D_80162FA0;
extern ? D_80163068;
extern s32 D_80163238;
extern ? D_80164438;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
void func_80015C94(void *arg0, ? arg1, ? arg2, s32 arg3) {
f32 spA8;
f32 spA4;
Player *spA0;
s32 sp9C;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp88;
f32 sp84;
s16 sp7A;
u16 sp78;
s32 sp68;
s32 sp5C;
s16 *sp58;
u16 *sp54;
s32 *sp50;
s32 sp44;
f64 sp38;
f32 *temp_a3_4;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f12;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f16;
f32 temp_f18;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f2;
f32 temp_f6;
f64 temp_f0;
f64 temp_f16_2;
f64 temp_f2_2;
s16 *temp_a1;
s16 *temp_t0;
s16 *temp_v0_3;
s16 temp_v0_2;
s16 temp_v1;
s32 *temp_a3;
s32 *temp_a3_2;
s32 *temp_a3_3;
s32 temp_hi;
s32 temp_s1;
s32 temp_s1_2;
s32 temp_s1_3;
s32 temp_s1_4;
s32 temp_v0;
u16 *temp_t1_2;
u16 *temp_t2;
u16 temp_t1;
u16 temp_v1_2;
s32 *phi_a3;
u16 phi_f12;
s32 phi_s1;
f32 phi_f20;
f32 phi_f18;
s32 *phi_a3_2;
temp_v1 = arg0->unkAE;
D_80163238 = temp_v1;
temp_s1 = temp_v1 * 2;
temp_t1 = *(&D_801645B0 + temp_s1);
temp_v0 = arg3 * 2;
temp_a1 = temp_v0 + &D_80164668;
spA0 = &gPlayerOne[temp_v1];
sp58 = temp_a1;
sp5C = temp_v0;
sp9C = temp_v1;
sp68 = temp_t1;
*sp58 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, *temp_a1, temp_t1);
temp_t2 = (sp68 * 2) + &D_801645C8;
sp54 = temp_t2;
if (func_80007BF8(*(&D_80164438 + temp_s1) & 0xFFFF, *sp58 & 0xFFFF, 0x32, 0xF, *temp_t2) <= 0) {
temp_s1_2 = arg3 * 4;
temp_a3 = temp_s1_2 + &D_80164688;
sp50 = temp_a3;
func_8001A348(arg3, *temp_a3, *(&D_80164680 + sp5C), temp_a3);
phi_a3_2 = temp_a3;
phi_s1 = temp_s1_2;
goto block_8;
}
temp_f0 = *(&D_80163068 + (temp_v1 * 4));
if ((temp_f0 < -0.5) && (temp_s1_3 = arg3 * 4, temp_a3_2 = temp_s1_3 + &D_80164688, phi_s1 = temp_s1_3, (*temp_a3_2 < -0.5))) {
sp50 = temp_a3_2;
func_8001A348(arg3, 0x3F800000, 7, temp_a3_2);
phi_a3_2 = temp_a3_2;
goto block_8;
}
temp_s1_4 = arg3 * 4;
temp_a3_3 = temp_s1_4 + &D_80164688;
temp_f12 = *temp_a3_3;
phi_a3 = temp_a3_3;
phi_f12 = (bitwise u16) temp_f12;
phi_s1 = temp_s1_4;
phi_s1 = temp_s1_4;
if ((temp_f0 > 0.5) && (temp_f12 > 0.5)) {
sp50 = temp_a3_3;
func_8001A348((bitwise s32) temp_f12, arg3, 0xBF800000, 6, temp_a3_3);
phi_a3_2 = temp_a3_3;
block_8:
phi_a3 = phi_a3_2;
phi_f12 = *phi_a3_2;
}
temp_v1_2 = *sp54;
temp_v0_2 = *sp58;
sp50 = phi_a3;
temp_hi = (temp_v0_2 + 1) % temp_v1_2;
sp78 = (temp_v0_2 + 2) % temp_v1_2;
sp7A = temp_hi;
sp44 = sp6A;
func_8000BBD8(phi_f12, temp_hi & 0xFFFF, phi_f12, sp6A, phi_a3);
temp_f20 = D_80162FA0.unk0 * 0.5;
temp_f18 = D_80162FA0.unk8 * 0.5;
sp90 = temp_f18;
func_8000BBD8(sp78, *phi_a3, sp6A, phi_a3);
temp_v0_3 = (&D_80164550)[sp68];
temp_a3_4 = phi_s1 + &D_801645F8;
temp_t0 = phi_s1 + &D_80164618;
temp_f14 = (temp_f20 + (D_80162FA0.unk0 * 0.5)) - *temp_a3_4;
temp_t1_2 = phi_s1 + &D_80164638;
temp_f6 = ((temp_v0_3 + (sp78 * 8))->unk2 + (temp_v0_3 + (sp7A * 8))->unk2) * 0.5;
sp54 = temp_t1_2;
sp94 = temp_f6;
sp8C = temp_f14;
temp_f16 = temp_f6 - *temp_t0;
sp58 = temp_t0;
sp5C = temp_a3_4;
temp_f0_2 = (temp_f18 + (D_80162FA0.unk8 * 0.5)) - *temp_t1_2;
sp88 = temp_f16;
sp84 = temp_f0_2;
temp_f0_3 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f0_2 * temp_f0_2));
if (temp_f0_3 != 0.0) {
temp_f2 = *(&D_80164648 + phi_s1);
sp94 = ((temp_f2 * temp_f16) / temp_f0_3) + *temp_t0;
phi_f20 = ((temp_f2 * temp_f14) / temp_f0_3) + *temp_a3_4;
phi_f18 = ((temp_f2 * sp84) / temp_f0_3) + *temp_t1_2;
} else {
sp94 = *temp_t0;
phi_f20 = *temp_a3_4;
phi_f18 = *temp_t1_2;
}
arg0->unk0 = phi_f20;
arg0->unk8 = phi_f18;
temp_f16_2 = sp94;
sp38 = temp_f16_2;
sp90 = phi_f18;
sp54 = temp_t1_2;
sp58 = temp_t0;
sp5C = temp_a3_4;
temp_f2_2 = func_802AE1C0(phi_f20, temp_f16_2 + 30.0, phi_f18);
if ((temp_f2_2 < (temp_f16_2 - 20.0)) || (D_800ED230 <= temp_f2_2)) {
arg0->unk4 = temp_f16_2 + 10.0;
} else {
arg0->unk4 = temp_f2_2 + 8.0;
}
*temp_a3_4 = phi_f20;
*temp_t1_2 = phi_f18;
*temp_t0 = sp94;
arg0->unkC = spA0->posX;
arg0->unk10 = spA0->posY + 6.0;
arg0->unk14 = spA0->posZ;
func_80014D30(arg3, sp68);
temp_f20_2 = arg0->unkC - arg0->unk0;
spA8 = arg0->unk10 - arg0->unk4;
temp_f14_2 = arg0->unk14 - arg0->unk8;
spA4 = temp_f14_2;
arg0->unk26 = func_802B7830(temp_f20_2, temp_f14_2);
arg0->unk24 = func_802B7830(sqrtf((temp_f20_2 * temp_f20_2) + (temp_f14_2 * temp_f14_2)), spA8);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015C94.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(f32, s32, f32, s16, s16); // extern
extern ? D_80162FA0;
extern ? D_80164438;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
extern ? gPlayers;
void func_800162CC(s32 arg0, f32 arg1, s32 arg2, s16 arg3) {
s32 sp20;
u16 *sp1C;
f32 *temp_a0;
f32 *temp_a1;
f32 temp_f0;
f32 temp_f2;
s16 temp_a2;
s16 temp_a3;
s32 temp_t8;
s32 temp_t9;
u16 *temp_t0;
void *temp_v0;
temp_t8 = arg2 * 4;
temp_a3 = arg3;
temp_t0 = (arg2 * 2) + &D_80164668;
*(&D_80164688 + temp_t8) = arg1;
*temp_t0 = *(&D_80164438 + (arg0 * 2));
temp_t9 = *temp_t0 % *(&D_801645C8 + (arg3 * 2));
*temp_t0 = temp_t9;
temp_a2 = temp_a3;
sp1C = temp_t0;
sp20 = temp_t8;
arg3 = temp_a3;
func_8000BBD8(arg1, temp_t9 & 0xFFFF, arg1, temp_a2, temp_a3);
temp_f0 = D_80162FA0.unk0;
*(&D_801645F8 + temp_t8) = temp_f0;
temp_a0 = temp_t8 + &D_80164618;
temp_a1 = temp_t8 + &D_80164638;
*temp_a0 = ((&D_80164550)[arg3] + (*temp_t0 * 8))->unk2;
*temp_a1 = D_80162FA0.unk8;
temp_f2 = *(&gPlayers + 0x94 + (arg0 * 0xDD8));
*(&D_80164658 + temp_t8) = temp_f2;
temp_v0 = (arg2 * 0xB8) + &cameras;
*(&D_80164648 + temp_t8) = temp_f2;
temp_v0->unk0 = temp_f0;
temp_v0->unk4 = *temp_a0;
temp_v0->unk8 = *temp_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800162CC.s")
#endif
#ifdef MIPS_TO_C
//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;
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
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(s32, ?32, ?32, s32); // extern
extern ?32 D_800ED260;
extern ?32 D_800ED264;
extern f32 D_800ED268;
extern ? D_80162FA0;
extern ? D_80163DD8;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
void func_80016C3C(s32 arg0, ? arg1, s32 arg2) {
f32 sp5C;
f32 sp54;
u16 sp44;
s32 sp3C;
s32 *sp34;
f32 *sp2C;
f32 *sp28;
?32 *temp_s2;
?32 *temp_s2_2;
f32 *temp_t2;
f32 *temp_t3;
f32 temp_f12;
f32 temp_f2;
s16 *temp_s1;
s16 *temp_t7;
s16 temp_v1_2;
s16 temp_v1_3;
s32 *temp_v0;
s32 *temp_v1;
s32 temp_t6;
s32 temp_t6_2;
s32 temp_t8;
u16 temp_s0;
void *temp_v0_2;
s32 phi_a3;
?32 *phi_s2;
if (random_int(0x64) < 0x32) {
temp_t6 = arg2 * 4;
temp_s2 = temp_t6 + &D_80164688;
*temp_s2 = D_800ED260;
phi_a3 = temp_t6;
phi_s2 = temp_s2;
} else {
temp_t8 = arg2 * 4;
temp_s2_2 = temp_t8 + &D_80164688;
*temp_s2_2 = D_800ED264;
phi_a3 = temp_t8;
phi_s2 = temp_s2_2;
}
temp_v1 = phi_a3 + &D_80163DD8;
*temp_v1 = 0;
if (gCurrentCourseId == 4) {
sp34 = temp_v1;
sp3C = phi_a3;
*temp_v1 = random_int(4);
*phi_s2 = 0;
}
temp_s1 = (arg2 * 2) + &D_80164668;
temp_s0 = *(&D_801645C8 + (*(phi_a3 + &D_80163DD8) * 2));
temp_t6_2 = *temp_s1 % temp_s0;
*temp_s1 = temp_t6_2;
sp3C = phi_a3;
func_8000BBD8(temp_t6_2 & 0xFFFF, *phi_s2, 0, phi_a3);
temp_v1_2 = *temp_s1;
temp_t2 = phi_a3 + &D_80164618;
temp_v0 = phi_a3 + &D_801645F8;
*temp_v0 = D_80162FA0.unk0;
temp_t3 = phi_a3 + &D_80164638;
*temp_t3 = D_80162FA0.unk8;
*temp_t2 = (D_80164550 + (temp_v1_2 * 8))->unk2;
*(&D_80164658 + phi_a3) = D_800ED268;
*(&D_80164648 + phi_a3) = 0.0f;
sp44 = (temp_v1_2 + 0xB) % temp_s0;
sp28 = temp_t3;
sp2C = temp_t2;
sp34 = temp_v0;
func_8000BBD8(((temp_v1_2 + 0xA) % temp_s0) & 0xFFFF, *phi_s2, 0, phi_a3);
temp_f2 = D_80162FA0.unk0 * 0.5;
temp_f12 = D_80162FA0.unk8 * 0.5;
sp5C = temp_f2;
sp54 = temp_f12;
func_8000BBD8((bitwise s32) temp_f12, sp44, *phi_s2, 0);
temp_v1_3 = *temp_s1;
temp_t7 = D_80164550;
temp_v0_2 = (arg2 * 0xB8) + &cameras;
temp_v0_2->unkC = temp_f2 + (D_80162FA0.unk0 * 0.5);
temp_v0_2->unk14 = temp_f12 + (D_80162FA0.unk8 * 0.5);
temp_v0_2->unk10 = (((temp_t7 + (((temp_v1_3 + 6) % temp_s0) * 8))->unk2 + (temp_t7 + (((temp_v1_3 + 5) % temp_s0) * 8))->unk2) * 0.5f) + 8.0;
temp_v0_2->unk0 = *sp34;
temp_v0_2->unk4 = *sp2C;
temp_v0_2->unk8 = *sp28;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80016C3C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(u16, s32, s16, s16); // extern
s16 func_8000D33C(f32, f32, s32 *, s32 *, s16, s32); // extern
? func_80014D30(s32, s32, f32 *); // extern
s16 func_802B7830(f32, f32); // extern
extern f64 D_800ED270;
extern f64 D_800ED278;
extern ? D_80162FA0;
extern s32 D_80163238;
extern ? D_80163DD8;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164688;
void func_80017054(void *arg0, ? arg1, ? arg2, s32 arg3) {
f32 spAC;
f32 spA8;
f32 spA4;
f32 sp98;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp88;
f32 sp84;
f32 sp80;
f32 sp7C;
f32 sp78;
s16 sp6E;
u16 sp6C;
s32 sp5C;
s32 sp58;
s16 sp56;
s32 sp4C;
f32 *sp48;
s32 *sp44;
s16 *sp40;
f32 *sp3C;
s16 **sp2C;
f32 *temp_a2;
f32 *temp_t1;
f32 temp_f0;
f32 temp_f10;
f32 temp_f12;
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_f8;
f64 temp_f0_2;
s16 **temp_t2_2;
s16 *temp_a1_2;
s16 *temp_t0;
s16 *temp_t0_2;
s16 *temp_t0_3;
s16 temp_a3;
s16 temp_a3_2;
s16 temp_a3_3;
s16 temp_a3_4;
s32 *temp_a0;
s32 *temp_a1;
s32 *temp_v1;
s32 temp_hi;
s32 temp_t2;
s32 temp_t6;
s32 temp_v0;
f32 phi_f14;
s32 *phi_f16;
temp_t6 = arg3 * 4;
temp_t1 = temp_t6 + &D_80164648;
temp_f2 = *temp_t1;
temp_a1 = temp_t6 + &D_80163DD8;
temp_t2 = *temp_a1;
*temp_t1 = temp_f2 + ((*(&D_80164658 + temp_t6) - temp_f2) * 0.5f);
temp_t0 = (arg3 * 2) + &D_80164668;
D_80163238 = arg0->unkAE;
temp_a3 = *temp_t0;
sp58 = *(&D_801645C8 + (temp_t2 * 2));
sp56 = temp_a3;
sp48 = temp_t1;
sp40 = temp_t0;
sp44 = temp_a1;
sp4C = temp_t6;
sp5C = temp_t2;
*sp40 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, temp_a3, temp_t2);
if (gCurrentCourseId == 4) {
temp_a3_2 = *sp40;
if ((sp56 != temp_a3_2) && (temp_a3_2 == 1)) {
temp_v0 = random_int(4);
*sp44 = temp_v0;
sp5C = temp_v0;
*sp40 = func_8000D33C(arg0->unk0, arg0->unk4, arg0->unk8, *sp40, temp_v0);
}
}
temp_a3_3 = *sp40;
temp_v1 = sp4C + &D_80164688;
sp6C = (temp_a3_3 + 0xB) % sp58;
sp44 = temp_v1;
sp3C = sp5E;
func_8000BBD8(((temp_a3_3 + 0xA) % sp58) & 0xFFFF, *temp_v1, sp5E, temp_a3_3);
sp8C = D_80162FA0.unk0 * 0.5;
sp84 = D_80162FA0.unk8 * 0.5;
func_8000BBD8(sp6C, *sp44, sp3E);
sp8C = sp8C + (D_80162FA0.unk0 * 0.5);
sp84 = sp84 + (D_80162FA0.unk8 * 0.5);
temp_a3_4 = *sp40;
temp_t2_2 = &(&D_80164550)[sp5C];
temp_t0_2 = *temp_t2_2;
temp_hi = (temp_a3_4 + 1) % sp58;
sp88 = ((temp_t0_2 + (((temp_a3_4 + 6) % sp58) * 8))->unk2 + (temp_t0_2 + (((temp_a3_4 + 5) % sp58) * 8))->unk2) * 0.5f;
sp2C = temp_t2_2;
sp6C = (temp_a3_4 + 2) % sp58;
sp6E = temp_hi;
func_8000BBD8(temp_hi & 0xFFFF, *sp44, sp3E, temp_a3_4);
temp_f14 = D_80162FA0.unk0 * 0.5;
temp_f16 = D_80162FA0.unk8 * 0.5;
sp98 = temp_f14;
sp90 = temp_f16;
func_8000BBD8(sp6C, *sp44, sp3E);
temp_t0_3 = *sp2C;
temp_a0 = sp4C + &D_801645F8;
temp_f10 = ((temp_t0_3 + (sp6C * 8))->unk2 + (temp_t0_3 + (temp_hi * 8))->unk2) * 0.5f;
temp_a1_2 = sp4C + &D_80164618;
temp_f18 = (temp_f14 + (D_80162FA0.unk0 * 0.5)) - *temp_a0;
sp94 = temp_f10;
temp_f2_2 = temp_f10 - *temp_a1_2;
temp_a2 = sp4C + &D_80164638;
sp3C = temp_a2;
sp7C = temp_f2_2;
temp_f8 = (temp_f16 + (D_80162FA0.unk8 * 0.5)) - *temp_a2;
sp80 = temp_f18;
sp40 = temp_a1_2;
sp44 = temp_a0;
sp78 = temp_f8;
temp_f0 = sqrtf((temp_f18 * temp_f18) + (temp_f2_2 * temp_f2_2) + (temp_f8 * temp_f8));
if (temp_f0 != 0.0) {
temp_f2_3 = *sp48;
sp94 = ((temp_f2_3 * sp7C) / temp_f0) + *temp_a1_2;
phi_f14 = ((temp_f2_3 * temp_f18) / temp_f0) + *temp_a0;
phi_f16 = (bitwise s32 *) (((temp_f2_3 * sp78) / temp_f0) + *temp_a2);
} else {
sp94 = *temp_a1_2;
phi_f14 = *temp_a0;
phi_f16 = (bitwise s32 *) *temp_a2;
}
temp_f0_2 = phi_f14;
if (!(temp_f0_2 < D_800ED270) && (D_800ED278 < temp_f0_2)) {
}
arg0->unk0 = phi_f14;
arg0->unk8 = phi_f16;
arg0->unk4 = sp94 + 10.0;
*temp_a0 = phi_f14;
*temp_a2 = (bitwise f32) phi_f16;
*temp_a1_2 = sp94;
arg0->unkC = sp8C;
arg0->unk14 = sp84;
arg0->unk10 = sp88 + 8.0;
func_80014D30(arg3, sp5C, temp_a2);
temp_f12 = arg0->unkC - arg0->unk0;
spA8 = arg0->unk10 - arg0->unk4;
spAC = temp_f12;
temp_f14_2 = arg0->unk14 - (bitwise f32) arg0->unk8;
spA4 = temp_f14_2;
arg0->unk26 = func_802B7830(temp_f12, temp_f14_2);
arg0->unk24 = func_802B7830(sqrtf((spAC * spAC) + (temp_f14_2 * temp_f14_2)), spA8);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80017054.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(s32, f32, s16, s16); // extern
extern ? D_80162FA0;
extern ? D_80163068;
extern ? D_80164438;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
extern ? gPlayers;
void func_80017720(s32 arg0, ? arg1, s32 arg2, s16 arg3) {
s32 sp1C;
s16 *sp18;
f32 *temp_a0;
f32 *temp_a1;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f2;
s16 *temp_t0;
s16 temp_a2;
s16 temp_a3;
s32 temp_t3;
s32 temp_t8;
void *temp_v0;
temp_a3 = arg3;
temp_f0 = *(&D_80163068 + (arg0 * 4));
temp_t8 = arg2 * 4;
temp_t0 = (arg2 * 2) + &D_80164668;
*(&D_80164688 + temp_t8) = temp_f0;
*temp_t0 = *(&D_80164438 + (arg0 * 2)) + 3;
temp_t3 = *temp_t0 % *(&D_801645C8 + (temp_a3 * 2));
*temp_t0 = temp_t3;
temp_a2 = temp_a3;
sp18 = temp_t0;
sp1C = temp_t8;
arg3 = temp_a3;
func_8000BBD8(temp_t3 & 0xFFFF, temp_f0, temp_a2, temp_a3);
temp_f0_2 = D_80162FA0.unk0;
*(&D_801645F8 + temp_t8) = temp_f0_2;
temp_a0 = temp_t8 + &D_80164618;
temp_a1 = temp_t8 + &D_80164638;
*temp_a0 = ((&D_80164550)[arg3] + (*temp_t0 * 8))->unk2;
*temp_a1 = D_80162FA0.unk8;
temp_f2 = *(&gPlayers + 0x94 + (arg0 * 0xDD8));
*(&D_80164658 + temp_t8) = temp_f2;
temp_v0 = (arg2 * 0xB8) + &cameras;
*(&D_80164648 + temp_t8) = temp_f2;
temp_v0->unk0 = temp_f0_2;
temp_v0->unk4 = *temp_a0;
temp_v0->unk8 = *temp_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80017720.s")
#endif
#ifdef MIPS_TO_C
//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;
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
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(s32, f32, s16, s16); // extern
extern ? D_80162FA0;
extern ? D_80163068;
extern ? D_80164438;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
extern ? gPlayers;
void func_80017F10(s32 arg0, ? arg1, s32 arg2, s16 arg3) {
s32 sp1C;
s16 *sp18;
f32 *temp_a0;
f32 *temp_a1;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f2;
s16 *temp_t0;
s16 temp_a2;
s16 temp_a3;
s32 temp_t3;
s32 temp_t9;
u16 temp_v0;
void *temp_v0_2;
temp_a3 = arg3;
temp_v0 = *(&D_801645C8 + (arg3 * 2));
temp_f0 = *(&D_80163068 + (arg0 * 4));
temp_t9 = arg2 * 4;
temp_t0 = (arg2 * 2) + &D_80164668;
*(&D_80164688 + temp_t9) = temp_f0;
*temp_t0 = (*(&D_80164438 + (arg0 * 2)) + temp_v0) - 2;
temp_t3 = *temp_t0 % temp_v0;
*temp_t0 = temp_t3;
temp_a2 = temp_a3;
sp18 = temp_t0;
sp1C = temp_t9;
arg3 = temp_a3;
func_8000BBD8(temp_t3 & 0xFFFF, temp_f0, temp_a2, temp_a3);
temp_f0_2 = D_80162FA0.unk0;
*(&D_801645F8 + temp_t9) = temp_f0_2;
temp_a0 = temp_t9 + &D_80164618;
temp_a1 = temp_t9 + &D_80164638;
*temp_a0 = ((&D_80164550)[arg3] + (*temp_t0 * 8))->unk2;
*temp_a1 = D_80162FA0.unk8;
temp_f2 = *(&gPlayers + 0x94 + (arg0 * 0xDD8));
*(&D_80164658 + temp_t9) = temp_f2;
temp_v0_2 = (arg2 * 0xB8) + &cameras;
*(&D_80164648 + temp_t9) = temp_f2;
temp_v0_2->unk0 = temp_f0_2;
temp_v0_2->unk4 = *temp_a0;
temp_v0_2->unk8 = *temp_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80017F10.s")
#endif
#ifdef MIPS_TO_C
//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;
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
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BA14(s32, f32, ?, s16); // extern
extern ? D_80162FA0;
extern ? D_80163068;
extern ? D_80164438;
extern s32 D_8016448C;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164658;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
extern ? gPlayers;
void func_80018718(s32 arg0, ? arg1, s32 arg2, s16 arg3) {
s32 sp1C;
s16 *sp18;
f32 *temp_a0;
f32 *temp_a1;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f2;
s16 *temp_t0;
s16 temp_a3;
s32 temp_hi;
s32 temp_t9;
u16 temp_v0;
void *temp_v0_2;
temp_a3 = arg3;
temp_v0 = *(&D_801645C8 + (arg3 * 2));
temp_f0 = *(&D_80163068 + (arg0 * 4));
temp_t9 = arg2 * 4;
temp_hi = ((*(&D_80164438 + (arg0 * 2)) + temp_v0) - 5) % temp_v0;
*(&D_80164688 + temp_t9) = temp_f0;
temp_t0 = (arg2 * 2) + &D_80164668;
*temp_t0 = temp_hi;
sp18 = temp_t0;
sp1C = temp_t9;
arg3 = temp_a3;
func_8000BA14(temp_hi & 0xFFFF, temp_f0, 0x42700000, temp_a3);
temp_f0_2 = D_80162FA0.unk0;
*(&D_801645F8 + temp_t9) = temp_f0_2;
temp_a0 = temp_t9 + &D_80164618;
temp_a1 = temp_t9 + &D_80164638;
*temp_a0 = ((&D_80164550)[arg3] + (*temp_t0 * 8))->unk2;
*temp_a1 = D_80162FA0.unk8;
temp_f2 = *(&gPlayers + 0x94 + (arg0 * 0xDD8));
*(&D_80164658 + temp_t9) = temp_f2;
*(&D_80164648 + temp_t9) = temp_f2;
D_8016448C = 1;
temp_v0_2 = (arg2 * 0xB8) + &cameras;
temp_v0_2->unk0 = temp_f0_2;
temp_v0_2->unk4 = *temp_a0;
temp_v0_2->unk8 = *temp_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80018718.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80007BF8(s32, s32, ?, ?, s32); // extern
? func_8000BA14(u16, f32, ?, s16); // extern
s16 func_8000D33C(f32, f32, s16, f32, s32, s32); // extern
? func_80014D30(s32, s32); // extern
? func_8001A348(s32, f32, s16); // extern
s16 func_802B7830(f32, f32); // extern
extern f64 D_800ED2A8;
extern f64 D_800ED2B0;
extern f64 D_800ED2B8;
extern f64 D_800ED2C0;
extern f32 D_800ED2C8;
extern f64 D_800ED2D0;
extern f64 D_800ED2D8;
extern f64 D_800ED2E0;
extern f64 D_800ED2E8;
extern f64 D_800ED2F0;
extern f32 D_800ED2F8;
extern f64 D_800ED300;
extern f64 D_800ED308;
extern ? D_80162FA0;
extern ? D_80163068;
extern s32 D_80163238;
extern ? D_80164438;
extern s32 D_8016448C;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
extern ? gPlayers;
void func_800188F4(void *arg0, ? arg1, ? arg2, s32 arg3) {
f32 spAC;
f32 spA8;
f32 spA4;
Player *spA0;
f32 sp98;
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp88;
f32 sp84;
s16 sp7A;
u16 sp78;
s32 sp68;
s32 sp64;
f32 *sp5C;
s32 sp58;
f32 *sp54;
f32 *sp50;
f32 *sp4C;
s32 sp48;
s16 *sp44;
s32 sp40;
u16 *sp3C;
f64 sp28;
f32 *temp_a3_2;
f32 *temp_t1;
f32 *temp_t5;
f32 *temp_v1;
f32 *temp_v1_2;
f32 *temp_v1_3;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f10;
f32 temp_f10_2;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f16;
f32 temp_f18;
f32 temp_f2_3;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f16_2;
f64 temp_f2;
f64 temp_f2_2;
f64 temp_f2_4;
s16 *temp_t3;
s16 *temp_t3_2;
s16 *temp_v0_2;
s16 temp_a1;
s16 temp_a3;
s16 temp_t0;
s16 temp_t0_2;
s32 temp_hi;
s32 temp_t4;
s32 temp_t9;
s32 temp_t9_2;
s32 temp_v0;
u16 *temp_t2;
u16 *temp_t8;
u16 *temp_t8_2;
u16 temp_t2_2;
u16 temp_t7;
f64 phi_f0;
f64 phi_f0_2;
s32 phi_ra;
s16 *phi_t3;
f32 *phi_v1;
f32 phi_f18;
spA0 = gPlayerOne;
temp_a1 = arg0->unkAE;
temp_v0 = temp_a1 * 2;
temp_t7 = *(&D_801645B0 + temp_v0);
sp68 = temp_t7;
temp_f12 = *(&gPlayers + 0x94 + (temp_a1 * 0xDD8));
temp_t2 = &D_801645C8 + (temp_t7 * 2);
temp_t4 = arg3 * 4;
temp_t2_2 = *temp_t2;
temp_t5 = temp_t4 + &D_80164648;
*temp_t5 = temp_f12;
if (D_8016448C == 0) {
temp_t8 = temp_v0 + &D_80164438;
temp_t9 = arg3 * 2;
temp_t3 = temp_t9 + &D_80164668;
sp3C = temp_t8;
temp_a3 = *temp_t3;
phi_ra = temp_t9;
phi_t3 = temp_t3;
if (temp_a3 == (((*temp_t8 + temp_t2_2) - 6) % temp_t2_2)) {
D_8016448C = 1;
}
temp_f2 = *(&D_80163068 + (temp_a1 * 4));
temp_v1 = temp_t4 + &D_80164688;
temp_f0 = *temp_v1;
phi_f0 = temp_f0;
phi_v1 = temp_v1;
if (temp_f0 < (temp_f2 - D_800ED2A8)) {
*temp_t5 = temp_f12 * D_800ED2B0;
}
if ((temp_f2 - 0.5) < temp_f0) {
*temp_v1 = temp_f0 - D_800ED2B8;
phi_f0 = *temp_v1;
}
if (phi_f0 < D_800ED2C0) {
*temp_v1 = D_800ED2C8;
*temp_t5 = temp_f12 * D_800ED2D0;
}
sp40 = temp_a3;
} else {
temp_t8_2 = temp_v0 + &D_80164438;
temp_t9_2 = arg3 * 2;
temp_t3_2 = temp_t9_2 + &D_80164668;
sp3C = temp_t8_2;
temp_t0 = *temp_t3_2;
phi_ra = temp_t9_2;
phi_t3 = temp_t3_2;
if (temp_t0 == ((*temp_t8_2 + 6) % temp_t2_2)) {
D_8016448C = 0;
}
temp_f2_2 = *(&D_80163068 + (temp_a1 * 4));
temp_v1_2 = temp_t4 + &D_80164688;
temp_f0_2 = *temp_v1_2;
phi_f0_2 = temp_f0_2;
phi_v1 = temp_v1_2;
if ((temp_f2_2 + D_800ED2D8) < temp_f0_2) {
*temp_t5 = temp_f12 * D_800ED2E0;
}
if (temp_f0_2 < (temp_f2_2 + 0.5)) {
*temp_v1_2 = temp_f0_2 + D_800ED2E8;
phi_f0_2 = *temp_v1_2;
}
sp40 = temp_t0;
if (D_800ED2F0 < phi_f0_2) {
*temp_v1_2 = D_800ED2F8;
sp40 = temp_t0;
*temp_t5 = temp_f12 * D_800ED300;
}
}
D_80163238 = temp_a1;
spA0 = &spA0[temp_a1];
sp48 = phi_ra;
sp54 = temp_t5;
sp58 = temp_t4;
sp44 = phi_t3;
sp64 = temp_t2_2;
sp5C = phi_v1;
*phi_t3 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, sp40, sp68);
if (func_80007BF8(*sp3C & 0xFFFF, *phi_t3 & 0xFFFF, 0xF, 0xF, temp_t2_2) <= 0) {
sp5C = phi_v1;
sp64 = temp_t2_2;
sp44 = phi_t3;
sp58 = temp_t4;
sp54 = temp_t5;
func_8001A348(arg3, *phi_v1, *(&D_80164680 + phi_ra));
}
temp_t0_2 = *phi_t3;
temp_hi = (temp_t0_2 + 1) % *temp_t2;
sp78 = (temp_t0_2 + 2) % *temp_t2;
sp7A = temp_hi;
sp5C = phi_v1;
sp58 = arg3 * 4;
sp54 = temp_t4 + &D_80164648;
sp50 = sp6A;
func_8000BA14(temp_hi & 0xFFFF, *phi_v1, 0x42700000, sp6A);
temp_f10 = D_80162FA0.unk0 * 0.5;
sp98 = temp_f10;
temp_f18 = D_80162FA0.unk8 * 0.5;
sp90 = temp_f18;
func_8000BA14(sp78, *phi_v1, 0x42700000, sp6A);
temp_v0_2 = (&D_80164550)[sp68];
temp_f10_2 = temp_f10 + (D_80162FA0.unk0 * 0.5);
sp98 = temp_f10_2;
temp_v1_3 = (arg3 * 4) + &D_801645F8;
temp_a3_2 = (arg3 * 4) + &D_80164618;
temp_f14 = temp_f10_2 - *temp_v1_3;
temp_t1 = (arg3 * 4) + &D_80164638;
sp4C = temp_t1;
sp8C = temp_f14;
sp50 = temp_a3_2;
sp5C = temp_v1_3;
temp_f16 = (((temp_v0_2 + (sp78 * 8))->unk2 + (temp_v0_2 + (sp7A * 8))->unk2) * 0.5) - *temp_a3_2;
temp_f0_3 = (temp_f18 + (D_80162FA0.unk8 * 0.5)) - *temp_t1;
sp88 = temp_f16;
sp84 = temp_f0_3;
temp_f0_4 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f0_3 * temp_f0_3));
if (temp_f0_4 != 0.0) {
temp_f2_3 = *(temp_t4 + &D_80164648);
sp98 = ((temp_f2_3 * temp_f14) / temp_f0_4) + *temp_v1_3;
sp94 = ((temp_f2_3 * temp_f16) / temp_f0_4) + *temp_a3_2;
phi_f18 = ((temp_f2_3 * sp84) / temp_f0_4) + *temp_t1;
} else {
sp98 = *temp_v1_3;
sp94 = *temp_a3_2;
phi_f18 = *temp_t1;
}
arg0->unk8 = phi_f18;
arg0->unk0 = sp98;
temp_f16_2 = sp94;
sp28 = temp_f16_2;
sp90 = phi_f18;
sp4C = temp_t1;
sp50 = temp_a3_2;
sp5C = temp_v1_3;
temp_f2_4 = func_802AE1C0(sp98, temp_f16_2 + 30.0, phi_f18);
if ((temp_f2_4 < (temp_f16_2 - 20.0)) || (D_800ED308 <= temp_f2_4)) {
arg0->unk4 = temp_f16_2 + 10.0;
} else {
arg0->unk4 = temp_f2_4 + 8.0;
}
*temp_t1 = phi_f18;
*temp_v1_3 = sp98;
*temp_a3_2 = sp94;
arg0->unkC = spA0->posX;
arg0->unk10 = spA0->posY + 6.0;
arg0->unk14 = spA0->posZ;
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)), spA8);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800188F4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8000BBD8(f32, s32, f32, ?, s32); // extern
extern f64 D_800ED310;
extern ? D_80162FA0;
extern ? D_80164438;
extern u16 D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164668;
extern ? D_80164688;
extern ? cameras;
void func_80019118(s32 arg0, f32 arg1, s32 arg2, ? arg3) {
s32 sp2C;
s16 *sp28;
f32 *sp24;
f32 *sp20;
f64 sp18;
f32 *temp_a0;
f32 *temp_a1;
f32 *temp_v1;
f32 *temp_v1_2;
f32 temp_f0;
f32 temp_f12;
f64 temp_f12_2;
f64 temp_f2;
s16 *temp_v0;
s32 temp_t5;
s32 temp_t6;
void *temp_v0_2;
f32 *phi_v1;
temp_t6 = arg2 * 4;
temp_v0 = (arg2 * 2) + &D_80164668;
*(&D_80164688 + temp_t6) = arg1;
*temp_v0 = *(&D_80164438 + (arg0 * 2)) + 0xC;
temp_t5 = *temp_v0 % D_801645C8;
*temp_v0 = temp_t5;
sp2C = temp_t6;
sp28 = temp_v0;
func_8000BBD8(arg1, temp_t5 & 0xFFFF, arg1, 0, temp_t6);
temp_f12 = D_80162FA0.unk0;
temp_f0 = D_80162FA0.unk8;
temp_a0 = temp_t6 + &D_801645F8;
temp_a1 = temp_t6 + &D_80164638;
*temp_a0 = temp_f12;
*temp_a1 = temp_f0;
sp20 = temp_a1;
sp24 = temp_a0;
temp_f2 = (D_80164550 + (*temp_v0 * 8))->unk2;
sp18 = temp_f2;
temp_f12_2 = func_802AE1C0(temp_f12, temp_f2 + 30.0, temp_f0);
if ((temp_f12_2 < (temp_f2 - 20.0)) || (D_800ED310 <= temp_f12_2)) {
temp_v1_2 = temp_t6 + &D_80164618;
*temp_v1_2 = temp_f2 + 10.0;
phi_v1 = temp_v1_2;
} else {
temp_v1 = temp_t6 + &D_80164618;
*temp_v1 = temp_f12_2 + 10.0;
phi_v1 = temp_v1;
}
*(&D_80164648 + temp_t6) = 0.0f;
temp_v0_2 = (arg2 * 0xB8) + &cameras;
temp_v0_2->unk0 = *temp_a0;
temp_v0_2->unk4 = *phi_v1;
temp_v0_2->unk8 = *temp_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019118.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_80007BF8(s32, s32, ?, ?, s32); // extern
s16 func_8000D33C(f32, f32, u16, f32, s16, s32); // extern
? func_80014D30(s32, s32); // extern
? func_8001A348(s32, s32, s16); // extern
s16 func_802B7830(f32, f32); // extern
extern f64 D_800ED318;
extern f64 D_800ED320;
extern ? D_80163068;
extern ? D_80164438;
extern ? D_801645B0;
extern ? D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
void func_8001933C(void *arg0, ? arg1, ? arg2, s32 arg3) {
s16 sp96;
f32 sp8C;
f32 sp88;
f32 sp84;
s32 sp7C;
s32 sp48;
s32 sp44;
s32 sp3C;
s32 sp38;
s16 *sp34;
Player *temp_s2;
f32 temp_f12;
f32 temp_f14;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f2;
s16 *temp_t0;
s16 temp_t3;
s16 temp_v1;
s32 temp_t2;
s32 temp_v0;
s32 temp_v1_2;
s32 temp_v1_3;
s32 temp_v1_4;
u16 temp_a1;
void *temp_v0_2;
s32 phi_v1;
temp_v1 = arg0->unkAE;
temp_t2 = temp_v1 * 2;
temp_a1 = *(&D_801645B0 + temp_t2);
sp44 = *(&D_801645C8 + (temp_a1 * 2));
temp_v0 = arg3 * 2;
temp_t0 = temp_v0 + &D_80164668;
sp34 = temp_t0;
sp38 = temp_v0;
sp3C = temp_t2;
sp7C = temp_v1;
sp48 = temp_a1;
temp_s2 = &gPlayerOne[temp_v1];
*temp_t0 = func_8000D33C(arg0->unk0, arg0->unk4, temp_a1, arg0->unk8, *temp_t0, 0);
temp_t3 = *temp_t0;
sp96 = temp_t3;
if (func_80007BF8(*(&D_80164438 + temp_t2) & 0xFFFF, temp_t3 & 0xFFFF, 0x32, 0x14, sp44) <= 0) {
temp_v1_2 = arg3 * 4;
sp3C = temp_v1_2;
func_8001A348(arg3, *(&D_80164688 + temp_v1_2), *(&D_80164680 + sp38));
goto block_8;
}
temp_f0 = *(&D_80163068 + (temp_v1 * 4));
temp_v1_3 = arg3 * 4;
if ((temp_f0 < -0.5) && (*(&D_80164688 + temp_v1_3) < -0.5)) {
sp3C = temp_v1_3;
func_8001A348(arg3, 0x3F800000, 0xD);
goto block_8;
}
temp_v1_4 = arg3 * 4;
phi_v1 = temp_v1_4;
if ((temp_f0 > 0.5) && (*(&D_80164688 + temp_v1_4) > 0.5)) {
sp3C = temp_v1_4;
func_8001A348(arg3, 0xBF800000, 0xC);
block_8:
phi_v1 = sp3C;
}
temp_f0_2 = D_800ED318;
temp_f2 = D_800ED320;
arg0->unk0 = *(&D_801645F8 + phi_v1);
arg0->unk4 = *(&D_80164618 + phi_v1);
arg0->unk8 = *(&D_80164638 + phi_v1);
temp_v0_2 = (&D_80164550)[sp48] + (sp96 * 8);
arg0->unkC = (temp_s2->posX * temp_f0_2) + (temp_f2 * temp_v0_2->unk0);
arg0->unk10 = (temp_s2->posY * temp_f0_2) + (temp_f2 * temp_v0_2->unk2);
arg0->unk14 = (temp_s2->posZ * temp_f0_2) + (temp_f2 * temp_v0_2->unk4);
func_80014D30(arg3, sp48);
temp_f12 = arg0->unkC - arg0->unk0;
sp88 = arg0->unk10 - arg0->unk4;
sp8C = temp_f12;
temp_f14 = arg0->unk14 - arg0->unk8;
sp84 = temp_f14;
arg0->unk26 = func_802B7830(temp_f12, temp_f14);
arg0->unk24 = func_802B7830(sqrtf((sp8C * sp8C) + (temp_f14 * temp_f14)), sp88);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001933C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80164678;
void func_8001968C(void) {
D_80164678 = 3;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001968C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern u16 D_801645C8;
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164648;
extern ? D_80164668;
extern ? D_80164678;
void func_8001969C(s32 arg0, ? arg1, s32 arg2, ? arg3) {
s16 *temp_v1;
s32 temp_a1;
s32 temp_v0;
void *temp_a0;
temp_v0 = arg2 * 2;
temp_v1 = temp_v0 + &D_80164668;
*temp_v1 = D_801645C8 - 0x12;
temp_a0 = (*temp_v1 * 8) + D_80164550;
temp_a1 = arg2 * 4;
*(&D_801645F8 + temp_a1) = temp_a0->unk0;
*(&D_80164618 + temp_a1) = temp_a0->unk2 + 10.0;
*(&D_80164638 + temp_a1) = temp_a0->unk4;
*(&D_80164648 + temp_a1) = 0.0f;
*(&D_80164678 + temp_v0) = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001969C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80014D30(s32, ?); // extern
s16 func_802B7830(f32, f32); // extern
extern ? D_801645F8;
extern ? D_80164618;
extern ? D_80164638;
extern ? D_80164668;
void func_80019760(void *arg0, ? arg1, ? arg2, s32 arg3) {
f32 sp2C;
f32 sp28;
f32 sp24;
f32 temp_f12;
f32 temp_f14;
s32 temp_v0;
void *temp_v1;
temp_v0 = arg3 * 4;
arg0->unk0 = *(&D_801645F8 + temp_v0);
arg0->unk4 = *(&D_80164618 + temp_v0);
arg0->unk8 = *(&D_80164638 + temp_v0);
temp_v1 = (*(&D_80164668 + (arg3 * 2)) * 8) + D_80164550;
arg0->unkC = temp_v1->unk0;
arg0->unk10 = temp_v1->unk2;
arg0->unk14 = temp_v1->unk4;
func_80014D30(arg3, 0);
temp_f12 = arg0->unkC - arg0->unk0;
sp28 = arg0->unk10 - arg0->unk4;
sp2C = temp_f12;
temp_f14 = arg0->unk14 - arg0->unk8;
sp24 = temp_f14;
arg0->unk26 = func_802B7830(temp_f12, temp_f14);
arg0->unk24 = func_802B7830(sqrtf((sp2C * sp2C) + (temp_f14 * temp_f14)), sp28);
arg0->unk28 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019760.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_80015314(?, s32); /* extern */
? func_80015544(?, s32, u16); /* extern */
? func_80015A9C(?, s32, s16); /* extern */
? func_800162CC(?, s32, s16); /* extern */
? func_80016C3C(?, s32); /* extern */
? func_80017720(?, s32, s16); /* extern */
? func_80017F10(?, s32, s16); /* extern */
? func_80018718(?, s32, s16); /* extern */
? func_80019118(?, s32, s16); /* extern */
? func_8001969C(?, s32, s16); /* extern */
extern ? D_80163DD8;
extern ? D_801645B0;
extern ? D_80164668;
extern ? D_80164680;
extern ? D_801646C0;
void func_80019890(s16 arg0, s32 cameraId) {
void *sp28;
s32 sp24;
u16 *sp20;
Camera *temp_t6;
s32 temp_t0;
u16 *temp_t4;
u16 temp_s1;
u16 temp_t5;
temp_t6 = camera1;
sp28 = temp_t6;
sp28 = &temp_t6[cameraId];
temp_t6[cameraId].unkAE = arg0;
temp_t0 = cameraId * 2;
temp_t4 = temp_t0 + &D_80164680;
*(&D_801646C0 + temp_t0) = 0;
sp24 = temp_t0;
sp20 = temp_t4;
temp_t5 = *temp_t4;
temp_s1 = *(&D_801645B0 + (arg0 * 2));
switch (temp_t5) {
case 0:
func_80015314(0, cameraId);
break;
case 2:
func_80015544(0xBF800000, cameraId, temp_s1);
break;
case 3:
func_80015544(0x3F800000, cameraId, temp_s1);
break;
case 6:
func_80015A9C(0xBF19999A, cameraId, temp_s1);
break;
case 7:
func_80015A9C(0x3F19999A, cameraId, temp_s1);
break;
case 4:
func_800162CC(0xBF800000, cameraId, temp_s1);
break;
case 5:
func_800162CC(0x3F800000, cameraId, temp_s1);
break;
case 9:
func_80016C3C(0, cameraId);
break;
case 1:
func_80017720(0, cameraId, temp_s1);
break;
case 14:
func_80017F10(0, cameraId, temp_s1);
break;
case 8:
func_80018718(0, cameraId, temp_s1);
break;
case 12:
func_80019118(0xBF800000, cameraId, temp_s1);
break;
case 13:
func_80019118(0x3F800000, cameraId, temp_s1);
break;
case 15:
func_8001969C(0xBF800000, cameraId, temp_s1);
break;
case 16:
func_8001969C(0x3F800000, cameraId, temp_s1);
break;
default:
func_80015314(0, cameraId);
break;
}
*(&D_80164668 + sp24) = func_8000BD94(sp28->unk0, sp28->unk4, sp28->unk8, temp_s1);
if (*sp20 == 9) {
*(&D_80163DD8 + (cameraId * 4)) = temp_s1;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019890.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801646C0;
void func_80019B50(s32 arg0, s32 arg1) {
s32 temp_a0;
s32 temp_a0_2;
s32 temp_a2;
s32 temp_a2_2;
s32 temp_t6;
s32 temp_v0_2;
s32 temp_v0_3;
u16 *temp_v1;
u16 temp_v0;
s32 phi_a2;
s32 phi_a2_2;
u16 phi_v0;
temp_v1 = (arg0 * 2) + &D_801646C0;
temp_v0 = *temp_v1;
temp_t6 = arg1 & 0xFFFF;
phi_v0 = temp_v0;
if (temp_v0 < temp_t6) {
temp_a0 = temp_t6 - temp_v0;
if (temp_a0 < 0x8000) {
temp_a2 = (temp_v0 + 0x5A) & 0xFFFF;
phi_a2 = temp_a2;
phi_v0 = temp_a2;
if (temp_t6 < temp_a2) {
temp_v0_2 = temp_t6 & 0xFFFF;
phi_a2 = temp_v0_2;
phi_v0 = temp_v0_2;
}
if (phi_a2 < 0x5A) {
phi_v0 = 0;
}
} else if (temp_a0 >= 0x8000) {
phi_v0 = (temp_v0 - 0x5A) & 0xFFFF;
}
} else if (temp_t6 < temp_v0) {
temp_a0_2 = temp_v0 - temp_t6;
if (temp_a0_2 < 0x8000) {
temp_a2_2 = (temp_v0 - 0x5A) & 0xFFFF;
phi_a2_2 = temp_a2_2;
phi_v0 = temp_a2_2;
if (temp_a2_2 < temp_t6) {
temp_v0_3 = temp_t6 & 0xFFFF;
phi_a2_2 = temp_v0_3;
phi_v0 = temp_v0_3;
}
if (phi_a2_2 >= 0xFFA6) {
phi_v0 = 0;
}
} else if (temp_a0_2 >= 0x8000) {
phi_v0 = (temp_v0 + 0x5A) & 0xFFFF;
}
}
*temp_v1 = phi_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019B50.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800C9060(s32, ?, s32, s32); // extern
extern ? D_80164608;
extern ? D_80164670;
extern ? D_80164678;
void func_80019C50(s32 arg0) {
s32 sp20;
s16 *sp1C;
s16 *temp_v0;
s16 temp_v1;
s32 temp_a3;
temp_a3 = arg0 * 2;
temp_v0 = temp_a3 + &D_80164678;
temp_v1 = *temp_v0;
if (temp_v1 != 0) {
if (temp_v1 != 1) {
return;
}
if (*(&D_80164608 + (arg0 * 4)) == 1) {
*temp_v0 = 0;
sp1C = temp_v0;
sp20 = temp_a3;
func_800C9060(arg0 & 0xFF, 0x19009050, arg0, temp_a3);
*(&D_80164670 + temp_a3) = *temp_v0;
}
// Duplicate return node #7. Try simplifying control flow for better match
return;
}
if (*(&D_80164608 + (arg0 * 4)) == 1) {
*temp_v0 = 1;
sp1C = temp_v0;
sp20 = temp_a3;
func_800C9060(arg0 & 0xFF, 0x1900904F, arg0, temp_a3);
*(&D_80164670 + temp_a3) = *temp_v0;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019C50.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800151A4(s32); // extern
? func_80019B50(s32, s32, s32); // extern
extern s32 D_80163378;
extern ? D_80164438;
void func_80019D2C(void *arg0, void *arg1, s32 arg2) {
s32 sp1C;
s16 temp_v1;
u16 temp_v0;
temp_v1 = arg0->unkAE;
if ((D_80163378 != 0) && (gCurrentCourseId == 8)) {
sp1C = temp_v1;
func_800151A4(arg2);
temp_v0 = *(&D_80164438 + (temp_v1 * 2));
if (((temp_v0 >= 0x65) && (temp_v0 < 0xFA)) || ((temp_v0 >= 0x1AF) && (temp_v0 < 0x226))) {
func_80019B50(arg2, (arg1->unk206 * 2) & 0xFFFF, arg2);
return;
}
func_80019B50(arg2, 0, arg2);
// Duplicate return node #8. Try simplifying control flow for better match
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019D2C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_801646CC;
void func_80019DE4(void) {
D_801646CC = 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019DE4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80164360;
extern s16 D_80164670;
extern s16 D_80164678;
extern s16 D_8016467A;
extern s16 D_8016467C;
extern s16 D_8016467E;
extern s16 D_801646CC;
void func_80019DF4(void) {
D_80164670 = D_8016467E;
D_80164670 = D_8016467C;
D_80164670 = D_8016467A;
D_80164670 = D_80164678;
camera1->unkAE = D_80164360;
D_80164678 = 1;
D_801646CC = 2;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019DF4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80019890(?, ?); // extern
extern s16 D_80164670;
extern s16 D_80164672;
extern ? D_80164678;
extern s16 D_80164680;
extern s16 D_80164682;
void func_80019E58(void) {
D_80164680 = 1;
func_80019890(0, 0);
D_80164670 = D_80164678.unk0;
D_80164678.unk0 = 1;
D_80164682 = 9;
func_80019890(0, 1);
D_80164672 = D_80164678.unk2;
D_80164678.unk2 = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019E58.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80015314(s32, ?, s32); // extern
extern s32 gPlayerWinningIndex;
extern s16 D_80164360;
extern ? D_80164670;
extern s16 D_80164678;
extern s16 D_80164680;
void func_80019ED0(void) {
? *temp_v0;
s16 *temp_s0;
s16 *temp_s0_2;
s32 temp_s1;
s32 temp_v0_2;
s16 *phi_s0;
? *phi_v0;
s16 *phi_s2;
s32 phi_s1;
s16 *phi_s0_2;
phi_s0 = &D_80164678;
phi_v0 = &D_80164670;
do {
temp_s0 = phi_s0 + 2;
temp_v0 = phi_v0 + 2;
temp_v0->unk-2 = *phi_s0;
phi_s0 = temp_s0;
phi_v0 = temp_v0;
} while (temp_s0 < &D_80164680);
temp_v0_2 = gPlayerWinningIndex;
D_80164360 = temp_v0_2;
camera1->unkAE = temp_v0_2;
phi_s2 = &D_80164680;
phi_s1 = 0;
phi_s0_2 = &D_80164678;
do {
*phi_s2 = 0;
func_80015314(gPlayerWinningIndex, 0, phi_s1);
temp_s1 = phi_s1 + 1;
temp_s0_2 = phi_s0_2 + 2;
temp_s0_2->unk-2 = 1;
phi_s2 += 2;
phi_s1 = temp_s1;
phi_s0_2 = temp_s0_2;
} while (temp_s1 != 4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019ED0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801645D0;
extern ? D_801645E8;
extern ? D_80164608;
extern ? D_80164628;
void func_80019FB4(s32 arg0) {
s32 *temp_a0;
s32 *temp_a0_2;
s32 *temp_a1;
s32 *temp_v0_2;
s32 temp_v1;
s32 temp_v1_2;
struct Controller *temp_v0;
s32 phi_v1;
temp_v0 = &gControllerOne[arg0];
temp_v1 = arg0 * 4;
temp_a1 = temp_v1 + &D_801645D0;
phi_v1 = temp_v1;
if ((temp_v0->buttonPressed & 2) != 0) {
*temp_a1 = *temp_a1 + 1;
} else {
temp_v1_2 = arg0 * 4;
*(&D_801645D0 + temp_v1_2) = 0;
phi_v1 = temp_v1_2;
}
temp_a0 = phi_v1 + &D_801645E8;
if ((temp_v0->buttonPressed & 4) != 0) {
*temp_a0 = *temp_a0 + 1;
} else {
*(&D_801645E8 + phi_v1) = 0;
}
temp_a0_2 = phi_v1 + &D_80164608;
if ((temp_v0->buttonPressed & 8) != 0) {
*temp_a0_2 = *temp_a0_2 + 1;
} else {
*(&D_80164608 + phi_v1) = 0;
}
temp_v0_2 = phi_v1 + &D_80164628;
if ((temp_v0->buttonPressed & 1) != 0) {
*temp_v0_2 = *temp_v0_2 + 1;
return;
}
*(&D_80164628 + phi_v1) = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019FB4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80019C50(s32); // extern
? func_80019FB4(s32); // extern
void func_8001A0A4(s32 arg0, ? arg1, ? arg2, ? arg3, s32 arg4) {
func_80019FB4(arg4);
func_80019C50(arg4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A0A4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80019D2C(s32, s32, s32); // extern
? func_8001A0A4(s8, s32); // extern
void func_8001A0DC(s32 arg1, s32 arg2, s8 arg3, s32 arg4) {
func_8001A0A4(arg3, arg4);
func_80019D2C(arg1, arg2, arg4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A0DC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800CA270(); // extern
extern ? D_80164680;
void func_8001A124(s32 arg0, s32 arg1) {
s32 temp_v0;
temp_v0 = gPlayerPositions[arg0];
if (temp_v0 != 0) {
if ((temp_v0 != 1) && (temp_v0 != 2) && (temp_v0 != 3)) {
if (random_int(0x64) < 0x32) {
*(&D_80164680 + (arg1 * 2)) = 0xF;
return;
}
*(&D_80164680 + (arg1 * 2)) = 0x10;
return;
}
*(&D_80164680 + (arg1 * 2)) = 8;
return;
}
if (random_int(0x64) < 0x32) {
*(&D_80164680 + (arg1 * 2)) = 0xC;
} else {
*(&D_80164680 + (arg1 * 2)) = 0xD;
}
func_800CA270();
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A124.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
u32 random_int(?); /* extern */
extern ? D_80164680;
void func_8001A220(s32 arg0, s32 arg1) {
u32 temp_v0;
s16 phi_t9;
s16 *phi_at;
temp_v0 = random_int(6);
switch (temp_v0) {
case 0:
*(&D_80164680 + (arg1 * 2)) = 4;
return;
case 1:
phi_t9 = 5;
phi_at = &D_80164680 + (arg1 * 2);
block_9:
*phi_at = phi_t9;
return;
case 2:
*(&D_80164680 + (arg1 * 2)) = 6;
return;
case 3:
*(&D_80164680 + (arg1 * 2)) = 7;
return;
case 4:
*(&D_80164680 + (arg1 * 2)) = 8;
return;
case 5:
*(&D_80164680 + (arg1 * 2)) = 1;
return;
default:
phi_t9 = 8;
phi_at = &D_80164680 + (arg1 * 2);
goto block_9;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A220.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8001A310(s32 arg0, s32 arg1) {
s32 phi_a1;
phi_a1 = arg1;
if ((gCurrentCourseId == 2) && (arg1 != 0) && (arg0 >= 0xE7) && (arg0 < 0x1C2)) {
phi_a1 = 0;
}
return phi_a1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A310.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80019890(s32, s32); // extern
s16 func_8001A310(f32, s16, ?, s32); // extern
extern ? D_80164668;
extern ? D_80164680;
extern ? D_80164688;
extern ? D_8016479E;
void func_8001A348(s32 arg0, f32 arg1, ? arg2) {
s32 sp20;
s32 sp1C;
f32 *temp_at;
s16 temp_a0;
s16 temp_t7;
s32 temp_a3;
s32 temp_v1;
temp_a3 = arg0;
temp_v1 = arg0 * 2;
temp_t7 = *(&D_8016479E + (arg0 * 0xB8));
temp_at = &D_80164688 + (arg0 * 4);
temp_a0 = *(&D_80164668 + temp_v1);
sp1C = temp_v1;
arg0 = temp_a3;
sp20 = temp_t7;
*temp_at = arg1;
*(&D_80164680 + temp_v1) = func_8001A310(arg1, temp_a0, arg2, temp_a3);
func_80019890(sp20, arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A348.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80019890(f32, s16, s32, s16); // extern
extern ? D_80164680;
extern ? D_80164688;
extern ? D_8016479E;
void func_8001A3D8(s32 arg0, f32 arg1, s16 arg2) {
s16 *temp_v0;
s16 temp_a3;
temp_v0 = (arg0 * 2) + &D_80164680;
*(&D_80164688 + (arg0 * 4)) = arg1;
temp_a3 = *(&D_8016479E + (arg0 * 0xB8));
if (arg2 != *temp_v0) {
*temp_v0 = arg2;
func_80019890(arg1, temp_a3, arg0, temp_a3);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A3D8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80019890(s32, s32, s16 *, s32); // extern
s16 func_8001A310(s16, s32, s16 *, s32); // extern
extern ? D_80164668;
extern ? D_80164680;
extern ? gPlayers;
void func_8001A450(s32 arg0, s32 arg1, s32 arg2) {
s32 sp24;
s16 *sp18;
s16 *temp_a2;
s16 temp_v0;
s16 temp_v1;
s32 temp_a3;
s32 temp_t9;
temp_a3 = arg0;
if (((*(&gPlayers + 0xBC + (arg0 * 0xDD8)) & 0x1000000C) == 0) && ((temp_t9 = arg1 * 2, temp_a2 = temp_t9 + &D_80164680, temp_v1 = *temp_a2, sp18 = temp_a2, arg0 = temp_a3, sp24 = temp_v1, temp_v0 = func_8001A310(*(&D_80164668 + temp_t9), (temp_v1 + 1) % 0xA, temp_a2, temp_a3), (temp_v0 != temp_v1)) || (arg2 != arg0))) {
*temp_a2 = temp_v0;
func_80019890(arg2, arg1, temp_a2, arg0);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A450.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8001A450(s32, s32, s32); // extern
extern ? D_80164680;
void func_8001A518(s32 arg0, s32 arg1, s32 arg2) {
if (arg1 != 0) {
if ((arg1 != 1) && (arg1 != 2) && (arg1 != 3)) {
*(&D_80164680 + (arg2 * 2)) = 0;
return;
}
func_8001A450(arg2, arg0, arg2);
return;
}
*(&D_80164680 + (arg2 * 2)) = 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A518.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_800151A4(void *, s32); /* extern */
? func_80015390(void *, u16 *, s8, s32); /* extern */
? func_8001577C(void *, u16 *, s8, s32); /* extern */
? func_80015C94(void *, u16 *, s8, s32); /* extern */
? func_80016494(void *, u16 *, s8, s32); /* extern */
? func_80017054(void *, u16 *, s8, s32); /* extern */
? func_800178F4(void *, u16 *, s8, s32); /* extern */
? func_800180F0(void *, u16 *, s8, s32); /* extern */
? func_800188F4(void *, u16 *, s8, s32); /* extern */
? func_8001933C(void *, u16 *, s8, s32); /* extern */
? func_80019760(void *, u16 *, s8, s32); /* extern */
? func_80019890(s32, s32); /* extern */
? func_80019C50(s32); /* extern */
? func_80019D2C(void *, u16 *, s32, s32); /* extern */
? func_80019FB4(s32); /* extern */
? func_8001A124(?, s32, s32); /* extern */
? func_8001A220(?, s32, s32); /* extern */
? func_8001A3D8(s32, ?, s16, s32); /* extern */
? func_8001A450(s32, s32, s32, s32); /* extern */
? func_8001A518(s32, s32, ?, s32); /* extern */
extern ? gPlayerPositions;
extern ? D_80164680;
extern ? D_801646C0;
extern ? D_801646D0;
void func_8001A588(s32 arg0, void *arg1, u16 *arg2, s8 arg3, s32 cameraId) {
s32 sp44;
s16 *sp24;
f64 temp_f0;
f64 temp_f2;
s16 *temp_t8;
s16 temp_v0_7;
s16 temp_v1;
s32 temp_s0;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v1_2;
u16 temp_t3;
u16 temp_v0_3;
u32 temp_t1;
u32 temp_t4;
u32 temp_v0_5;
u32 temp_v0_6;
void *temp_v0_4;
s32 phi_s0;
u32 *phi_t0;
s32 phi_s0_2;
s32 phi_s0_3;
s32 phi_v1;
s32 phi_a3;
phi_s0 = arg1->unkAE;
if (gModeSelection == TIME_TRIALS) {
phi_s0 = 0;
}
func_80019FB4(cameraId);
temp_f0 = arg1->unk0;
phi_s0_2 = phi_s0;
if ((temp_f0 * 10.0) == (arg1->unkC * 10.0)) {
temp_f2 = arg1->unk8;
if ((temp_f2 * 10.0) == (arg1->unk14 * 10.0)) {
arg1->unk0 = temp_f0 + 100.0;
arg1->unk8 = temp_f2 + 100.0;
}
}
temp_v0 = gModeSelection;
if ((temp_v0 != BATTLE) && (*(&D_80164680 + (cameraId * 2)) == -1) && ((*arg2 & 0x800) != 0) && (D_801646CC == 0) && (D_801646C8 == 0)) {
if (temp_v0 == VERSUS) {
func_8001A220(0, phi_s0, cameraId);
} else {
func_8001A124(0, phi_s0, cameraId);
}
func_80019890(phi_s0, cameraId);
}
temp_v0_2 = cameraId * 2;
temp_t8 = temp_v0_2 + &D_80164680;
sp24 = temp_t8;
temp_v1 = *temp_t8;
if ((temp_v1 == 0xE) || (temp_v1 == 0)) {
func_80019D2C(arg1, arg2, cameraId, cameraId);
} else {
*(&D_801646C0 + temp_v0_2) = 0;
func_800151A4(arg1, cameraId);
}
temp_v0_3 = D_801646CC;
phi_t0 = &D_801646C8;
phi_a3 = cameraId;
if (temp_v0_3 != 1) {
if (temp_v0_3 != 2) {
temp_v0_4 = (cameraId * 8) + &D_801646D0;
if (temp_v0_4->unk0 == 1) {
temp_v0_4->unk0 = 0;
*(&cameras->unkAE + (cameraId * 0xB8)) = temp_v0_4->unk4;
func_8001A3D8(cameraId, 0, temp_v0_4->unk2, cameraId);
goto block_47;
}
} else {
temp_t4 = D_801646C8 + 1;
D_801646C8 = temp_t4;
if (temp_t4 >= 0xFB) {
D_801646C8 = 0;
}
if ((cameraId == 0) && (D_801646C8 == 0xA)) {
func_8001A450(phi_s0, cameraId, phi_s0, cameraId);
goto block_47;
}
}
} else {
temp_t1 = D_801646C8 + 1;
D_801646C8 = temp_t1;
if (temp_t1 >= 0x1F5) {
D_801646C8 = 0;
}
if ((cameraId == 0) && ((temp_v0_5 = D_801646C8, (temp_v0_5 == 0xA)) || (temp_v0_5 == 0xB))) {
func_8001A518(phi_s0, *(&gPlayerPositions + (phi_s0 * 4)), 0, cameraId);
phi_t0 = &D_801646C8;
}
phi_a3 = cameraId;
if ((gModeSelection != TIME_TRIALS) && (cameraId == 1) && ((temp_v0_6 = *phi_t0, (temp_v0_6 == 0x104)) || (temp_v0_6 == 0x105))) {
phi_v1 = 0;
if (D_8018EDF3 == TWO_PLAYERS_SELECTED) {
func_8001A518(phi_s0, *(&gPlayerPositions + (phi_s0 * 4)), 1, cameraId);
} else {
sp44 = phi_s0;
loop_34:
temp_s0 = phi_s0_2 + 1;
temp_v1_2 = phi_v1 + 1;
phi_s0_3 = temp_s0;
phi_v1 = temp_v1_2;
if (temp_s0 >= 8) {
phi_s0_3 = 1;
}
temp_v0_7 = gPlayers[phi_s0_3].unk_0CA;
phi_s0_2 = phi_s0_3;
if ((((temp_v0_7 & 2) != 0) || ((temp_v0_7 & 8) != 0)) && (temp_v1_2 != 8)) {
goto loop_34;
}
func_8001A450(sp44, cameraId, phi_s0_3, cameraId);
}
block_47:
phi_a3 = cameraId;
}
}
func_80019C50(phi_a3);
temp_t3 = *sp24;
switch (temp_t3) {
case 0:
func_80015390(arg1, arg2, arg3, cameraId);
return;
case 2:
case 3:
func_8001577C(arg1, arg2, arg3, cameraId);
return;
case 6:
case 7:
func_80015C94(arg1, arg2, arg3, cameraId);
return;
case 4:
case 5:
func_80016494(arg1, arg2, arg3, cameraId);
return;
case 9:
func_80017054(arg1, arg2, arg3, cameraId);
return;
case 1:
func_800178F4(arg1, arg2, arg3, cameraId);
return;
case 14:
func_800180F0(arg1, arg2, arg3, cameraId);
return;
case 8:
func_800188F4(arg1, arg2, arg3, cameraId);
return;
case 12:
case 13:
func_8001933C(arg1, arg2, arg3, cameraId);
return;
case 15:
case 16:
func_80019760(arg1, arg2, arg3, cameraId);
return;
default:
func_80015390(arg1, arg2, arg3, cameraId);
return;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A588.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801646D0;
void func_8001AAAC(s16 arg0, s16 arg1, s16 arg2) {
void *temp_v0;
temp_v0 = (arg0 * 8) + &D_801646D0;
if (temp_v0->unk0 == 0) {
temp_v0->unk0 = 1;
temp_v0->unk2 = arg1;
temp_v0->unk4 = arg2;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001AAAC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_801642D8;
extern ? D_80164358;
void func_8001AB00(void) {
? *temp_v1;
? *phi_v1;
phi_v1 = &D_801642D8;
do {
temp_v1 = phi_v1 + 0x40;
temp_v1->unk-30 = 0;
temp_v1->unk-2C = 0;
temp_v1->unk-2E = -1;
temp_v1->unk-2A = 0;
temp_v1->unk-28 = 0;
temp_v1->unk-20 = 0;
temp_v1->unk-1C = 0;
temp_v1->unk-1E = -1;
temp_v1->unk-1A = 0;
temp_v1->unk-18 = 0;
temp_v1->unk-10 = 0;
temp_v1->unk-C = 0;
temp_v1->unk-E = -1;
temp_v1->unk-A = 0;
temp_v1->unk-8 = 0;
temp_v1->unk-40 = 0;
temp_v1->unk-3C = 0;
temp_v1->unk-3E = -1;
temp_v1->unk-3A = 0;
temp_v1->unk-38 = 0;
phi_v1 = temp_v1;
} while (temp_v1 != &D_80164358);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001AB00.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
void func_8001AB74(s32 arg0, s16 *arg1, s32 arg2) {
s32 phi_v0;
phi_v0 = -1;
switch (arg2) {
case 9:
phi_v0 = 0xD;
break;
case 11:
phi_v0 = 0x1B;
break;
case 1:
phi_v0 = 1;
break;
case 8:
phi_v0 = 0x16;
break;
case 10:
phi_v0 = 0x19;
break;
case 12:
phi_v0 = 0x1D;
break;
}
if (phi_v0 >= 0) {
*arg1 = phi_v0;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001AB74.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_8001ABE0(s32 arg0, ? arg1) {
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001ABE0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_8001ABEC(void *arg0) {
s16 temp_v0;
temp_v0 = arg0->unk2;
if ((temp_v0 < 0) || (temp_v0 >= 0x64)) {
arg0->unk0 = 0;
arg0->unk4 = 0;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001ABEC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
s32 func_80007BF8(u16, u16, ?, ?, s32); /* extern */
? func_8001AB74(s32, void *, s32); /* extern */
? func_8001ABE0(s32, void *); /* extern */
? func_8001ABEC(void *, s16); /* extern */
s32 func_8007AF78(s16, s16, ? *); /* extern */
? func_8009E5BC(); /* extern */
? func_800C92CC(s32, ?, s32, void *); /* extern */
? func_800C98B8(u16 *, u16 *, ?); /* extern */
? func_800CAC60(s32); /* extern */
? func_800CAD40(u8, s16); /* extern */
? func_802A1064(void *, s16); /* extern */
? func_802B0648(void *, s32, s32, void *); /* extern */
s16 func_802B2D70(u16 *, s16, ? *); /* extern */
? func_802B2EBC(u16 *, s16); /* extern */
s32 random_int(?, s16); /* extern */
extern ? D_8015F9B8;
extern ? D_801631E0;
extern ? D_801642D8;
extern ? gPlayerPositions;
extern ? D_80164438;
extern ? D_80164450;
extern ? D_80164550;
extern ? D_801645C8;
void func_8001AC10(s32 playerId, s32 *arg2) {
u16 *sp2C;
void *sp28;
s16 temp_a1;
s16 temp_a2;
s16 temp_v1_2;
s16 temp_v1_3;
s16 temp_v1_4;
s16 temp_v1_5;
s16 temp_v1_6;
s16 temp_v1_7;
s16 temp_v1_8;
s16 temp_v1_9;
s32 temp_a0;
s32 temp_t7;
s32 temp_v0;
s32 temp_v1;
u16 *temp_t9;
u16 temp_v0_2;
void *temp_a3;
void *temp_a3_10;
void *temp_a3_11;
void *temp_a3_12;
void *temp_a3_13;
void *temp_a3_2;
void *temp_a3_3;
void *temp_a3_4;
void *temp_a3_5;
void *temp_a3_6;
void *temp_a3_7;
void *temp_a3_8;
void *temp_a3_9;
void *temp_s0;
void *temp_v0_3;
s32 phi_v1;
s16 phi_v0;
temp_t9 = (playerId * 0xDD8) + gPlayerOne;
sp2C = temp_t9;
if ((gModeSelection != TIME_TRIALS) && (D_801646CC != 1) && ((*temp_t9 & 0x800) == 0)) {
temp_s0 = (playerId * 0x10) + &D_801642D8;
temp_a1 = temp_s0->unk0;
switch (temp_a1) { /* switch 1 */
case 0: /* switch 1 */
temp_s0->unk2 = -1;
temp_v0 = playerId * 4;
if ((((playerId * 0x14) + 0x64) < *(&D_80164450 + temp_v0)) && (temp_s0->unk4 >= 0x259) && (temp_s0->unk6 < 3) && (temp_v1 = gLapCountByPlayerId[playerId], ((temp_v1 < 3) != 0))) {
func_8001AB74(playerId, temp_s0, func_8007AF78(temp_v1, (&gPlayerPositions + temp_v0)->unk2, &gPlayerPositions));
} else {
func_8001ABE0(playerId, temp_s0);
}
default: /* switch 1 */
block_194:
break;
case 1: /* switch 1 */
if ((gLapCountByPlayerId[playerId] > 0) && (temp_v1_2 = D_80163478, temp_a0 = *(&gPlayerPositions + (temp_v1_2 * 4)), ((temp_a0 < *(&gPlayerPositions + (playerId * 4))) != 0)) && (temp_a0 == 0)) {
temp_v0_2 = sp2C->unk254;
if (temp_v0_2 != 4) {
if (temp_v0_2 != 6) {
if (func_80007BF8(*(&D_80164438 + (playerId * 2)), *(&D_80164438 + (temp_v1_2 * 2)), 0xA, 2, D_80164430) > 0) {
temp_s0->unk0 = 0x22;
}
} else if (func_80007BF8(*(&D_80164438 + (playerId * 2)), *(&D_80164438 + (temp_v1_2 * 2)), 4, 2, D_80164430) > 0) {
temp_s0->unk0 = 0x22;
}
} else if (func_80007BF8(*(&D_80164438 + (playerId * 2)), *(&D_80164438 + (temp_v1_2 * 2)), 0x28, 2, D_80164430) > 0) {
temp_s0->unk0 = 0x22;
}
} else if (temp_a1 == 1) {
temp_s0->unk2 = func_802B2D70(sp2C, temp_a1, &gPlayerPositions);
temp_v1_3 = temp_s0->unk2;
if ((temp_v1_3 >= 0) && (temp_v1_3 < 0x64)) {
sp2C->unkC = sp2C->unkC | 0x40000;
temp_s0->unk0 = 2;
temp_s0->unk4 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
temp_s0->unkE = (random_int(3) * 0x14) + 0xA;
} else {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
}
}
goto block_194;
case 2: /* switch 1 */
temp_a3 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3->unk2 & 0x8000) == 0) || (temp_a3->unk0 != 6) || (temp_a3->unk6 != 0) || (playerId != temp_a3->unk10)) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
sp2C->unkC = sp2C->unkC & 0xFFFBFFFF;
goto block_194;
}
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk0 = 3;
goto block_194;
}
break;
case 3: /* switch 1 */
temp_a3_2 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_2->unk2 & 0x8000) == 0) || (temp_a3_2->unk0 != 6) || (temp_a3_2->unk6 != 0) || (playerId != temp_a3_2->unk10)) {
if (playerId != temp_a3_2->unk10) {
}
} else {
temp_a3_2->unk6 = 1;
temp_a3_2->unk24 = 0.0f;
temp_a3_2->unk28 = 0.0f;
temp_a3_2->unk2C = 0.0f;
if (*(&D_801631E0 + (playerId * 2)) == 1) {
sp28 = temp_a3_2;
temp_a3_2->unk1C = func_802AE1C0(sp2C->unk14, sp2C->unk18 + 30.0, (bitwise s16) sp2C->unk1C, (bitwise f32) temp_a3_2) + (temp_a3_2->unkC + 1.0f);
}
}
sp2C->unkC = sp2C->unkC & 0xFFFBFFFF;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
case 34: /* switch 1 */
temp_s0->unk2 = func_802B2D70(sp2C, temp_a1);
temp_v1_4 = temp_s0->unk2;
if ((temp_v1_4 >= 0) && (temp_v1_4 < 0x64)) {
temp_a3_3 = (temp_v1_4 * 0x70) + &D_8015F9B8;
temp_a3_3->unk6 = 4;
sp2C->unkC = sp2C->unkC | 0x40000;
temp_s0->unk0 = 0x23;
temp_s0->unk4 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
temp_a2 = D_80163478;
temp_t7 = temp_a2 * 2;
temp_v0_3 = (((*(&D_80164438 + temp_t7) + 0x1E) % *(&D_801645C8 + ((&D_801645B0)[temp_a2] * 2))) * 8) + *(&D_80164550 + (D_801645B0 * 4));
temp_a3_3->unk24 = (temp_v0_3->unk0 - sp2C->unk14) / 20.0;
temp_a3_3->unk28 = ((temp_v0_3->unk2 - sp2C->unk18) / 20.0) + 4.0;
temp_a3_3->unk2C = (temp_v0_3->unk4 - sp2C->unk1C) / 20.0;
temp_a3_3->unk1C = sp2C->unk18;
func_800C92CC(playerId & 0xFF, 0x29008009, temp_t7, temp_a3_3);
func_800C98B8(sp2C + 0x14, sp2C + 0x34, 0x19018014);
} else {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
}
goto block_194;
case 35: /* switch 1 */
temp_a3_4 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_4->unk2 & 0x8000) == 0) || (temp_a3_4->unk0 != 6) || (temp_a3_4->unk6 != 4) || (playerId != temp_a3_4->unk10)) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
sp2C->unkC = sp2C->unkC & 0xFFFBFFFF;
goto block_194;
}
temp_a3_4->unk18 = temp_a3_4->unk18 + temp_a3_4->unk24;
temp_a3_4->unk28 = temp_a3_4->unk28 - 0.4;
temp_a3_4->unk20 = temp_a3_4->unk20 + temp_a3_4->unk2C;
temp_a3_4->unk1C = temp_a3_4->unk1C + temp_a3_4->unk28;
if (temp_s0->unk4 >= 0x15) {
temp_s0->unk0 = 0x24;
goto block_194;
}
break;
case 36: /* switch 1 */
temp_a3_5 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_5->unk2 & 0x8000) == 0) || (temp_a3_5->unk0 != 6) || (temp_a3_5->unk6 != 4) || (playerId != temp_a3_5->unk10)) {
if (playerId != temp_a3_5->unk10) {
}
} else {
temp_a3_5->unk6 = 1;
temp_a3_5->unk24 = 0.0f;
temp_a3_5->unk28 = 0.0f;
temp_a3_5->unk2C = 0.0f;
sp28 = temp_a3_5;
temp_a3_5->unk1C = func_802AE1C0(temp_a3_5->unk18, temp_a3_5->unk1C + 30.0, temp_a3_5->unk20, (bitwise f32) temp_a3_5) + (temp_a3_5->unkC + 1.0f);
}
sp2C->unkC = sp2C->unkC & 0xFFFBFFFF;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
case 4: /* switch 1 */
if (D_80150110 < 0x50) {
temp_s0->unk2 = func_802B1C9C(sp2C, temp_a1);
temp_v1_5 = temp_s0->unk2;
if ((temp_v1_5 >= 0) && (temp_v1_5 < 0x64)) {
temp_s0->unk0 = 5;
temp_s0->unk4 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
temp_s0->unkE = (random_int(3) * 0x14) + 0xA;
} else {
goto block_71;
}
} else {
block_71:
temp_s0->unk0 = 0;
}
goto block_194;
case 5: /* switch 1 */
temp_a3_6 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_6->unk2 & 0x8000) == 0) || (temp_a3_6->unk0 != 7) || (temp_a3_6->unk6 != 0) || (playerId != temp_a3_6->unk14)) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
}
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 6;
goto block_194;
}
break;
case 6: /* switch 1 */
temp_a3_7 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_7->unk2 & 0x8000) == 0) || (temp_a3_7->unk0 != 7) || (temp_a3_7->unk6 != 0) || (playerId != temp_a3_7->unk14)) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
} else {
temp_a3_7->unk6 = 1;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
}
goto block_194;
case 7: /* switch 1 */
if (D_80150110 < 0x50) {
temp_s0->unk2 = func_802B1E48(sp2C, temp_a1);
temp_v1_6 = temp_s0->unk2;
if ((temp_v1_6 >= 0) && (temp_v1_6 < 0x64)) {
temp_s0->unk0 = 8;
temp_s0->unk4 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
temp_s0->unkE = (random_int(3) * 0x14) + 0xA;
} else {
goto block_92;
}
} else {
block_92:
temp_s0->unk0 = 0;
}
goto block_194;
case 8: /* switch 1 */
temp_a3_8 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_8->unk2 & 0x8000) == 0) || (temp_a3_8->unk0 != 8) || (temp_a3_8->unk6 != 0) || (playerId != temp_a3_8->unk14)) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
}
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk0 = 9;
goto block_194;
}
break;
case 9: /* switch 1 */
func_8001ABEC(temp_s0, temp_a1);
temp_a3_9 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_9->unk2 & 0x8000) == 0) || (temp_a3_9->unk0 != 8) || (temp_a3_9->unk6 != 0) || (playerId != temp_a3_9->unk14)) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
} else {
temp_a3_9->unk6 = 1;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
}
goto block_194;
case 10: /* switch 1 */
if (D_80150110 < 0x50) {
temp_s0->unk2 = func_802B17F4(sp2C, temp_a1);
temp_v1_7 = temp_s0->unk2;
if ((temp_v1_7 >= 0) && (temp_v1_7 < 0x64)) {
temp_s0->unk0 = 0xB;
temp_s0->unk4 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
temp_s0->unkE = (random_int(3) * 0x14) + 0x3C;
} else {
goto block_113;
}
} else {
block_113:
temp_s0->unk0 = 0;
}
goto block_194;
case 11: /* switch 1 */
temp_a3_10 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (temp_a3_10->unk6 == 6) {
phi_v1 = 0;
if (temp_a3_10->unk1A != -1) {
phi_v1 = 1;
}
if (temp_a3_10->unk18 != -1) {
phi_v1 = 1;
}
if (temp_a3_10->unk16 != -1) {
phi_v1 = 1;
}
if (temp_a3_10->unk14 != -1) {
phi_v1 = 1;
}
if (temp_a3_10->unk12 != -1) {
phi_v1 = 1;
}
if ((temp_a3_10->unk0 != 0xE) || (phi_v1 == 0)) {
temp_s0->unk0 = 0;
goto block_131;
}
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk0 = 0xC;
temp_s0->unk8 = 0;
block_131:
temp_s0->unk4 = 0;
}
}
goto block_194;
case 12: /* switch 1 */
if ((temp_s0->unk4 % 10) == 0) {
temp_v1_8 = temp_s0->unk8;
if (temp_v1_8 < 5) {
temp_a3_11 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
phi_v0 = 0;
switch (temp_v1_8) { /* switch 2 */
case 0: /* switch 2 */
if (temp_a3_11->unk1A != -1) {
block_146:
phi_v0 = 1;
}
break;
case 1: /* switch 2 */
if (temp_a3_11->unk18 != -1) {
goto block_146;
}
break;
case 2: /* switch 2 */
if (temp_a3_11->unk16 != -1) {
goto block_146;
}
break;
case 3: /* switch 2 */
if (temp_a3_11->unk14 != -1) {
goto block_146;
}
break;
case 4: /* switch 2 */
if (temp_a3_11->unk12 != -1) {
goto block_146;
}
break;
}
if ((temp_a3_11->unk0 == 0xE) && (temp_a3_11->unk6 == 6) && (phi_v0 == 1)) {
func_802B0648(temp_a3_11, 0xE, 6, temp_a3_11);
}
temp_s0->unk8 = temp_s0->unk8 + 1;
} else {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
}
goto block_194;
}
break;
case 13: /* switch 1 */
temp_s0->unk2 = func_802B2C40(sp2C, temp_a1);
temp_v1_9 = temp_s0->unk2;
if ((temp_v1_9 >= 0) && (temp_v1_9 < 0x64)) {
temp_s0->unk0 = 0xE;
temp_s0->unk4 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
temp_s0->unkE = (random_int(3, 0xE) * 0x14) + 0xA;
} else {
temp_s0->unk0 = 0;
}
goto block_194;
case 14: /* switch 1 */
temp_a3_12 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_12->unk2 & 0x8000) == 0) || (temp_a3_12->unk0 != 0xD) || (temp_a3_12->unk6 != 0) || (playerId != temp_a3_12->unk24)) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
}
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk0 = 0xF;
goto block_194;
}
break;
case 15: /* switch 1 */
temp_a3_13 = (temp_s0->unk2 * 0x70) + &D_8015F9B8;
if (((temp_a3_13->unk2 & 0x8000) == 0) || (temp_a3_13->unk0 != 0xD) || (temp_a3_13->unk6 != 0) || (playerId != temp_a3_13->unk24)) {
if (playerId != temp_a3_13->unk10) {
}
} else {
sp28 = temp_a3_13;
func_802A1064(temp_a3_13, temp_a1);
if (*(&D_801631E0 + (playerId * 2)) == 1) {
sp28 = temp_a3_13;
temp_a3_13->unk1C = func_802AE1C0(temp_a3_13->unk18, temp_a3_13->unk1C + 30.0, temp_a3_13->unk20, (bitwise f32) temp_a3_13) + temp_a3_13->unkC;
}
}
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
case 22: /* switch 1 */
func_802B2EBC(sp2C, temp_a1);
func_800CAC60(playerId & 0xFF);
func_8009E5BC();
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x17;
temp_s0->unk6 = temp_s0->unk6 + 1;
goto block_194;
case 23: /* switch 1 */
if (temp_s0->unk4 >= 0xF1) {
func_800CAD40(playerId, temp_a1);
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
goto block_194;
}
break;
case 25: /* switch 1 */
sp2C->unkC = sp2C->unkC | 0x2000;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x1A;
temp_s0->unk6 = temp_s0->unk6 + 1;
goto block_194;
case 26: /* switch 1 */
if ((sp2C->unkBC & 0x200) == 0) {
temp_s0->unk0 = 0;
}
temp_s0->unk4 = 0;
goto block_194;
case 27: /* switch 1 */
sp2C->unkC = sp2C->unkC | 0x800;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x1C;
temp_s0->unk6 = temp_s0->unk6 + 1;
goto block_194;
case 28: /* switch 1 */
if ((sp2C->unkBC << 0) >= 0) {
temp_s0->unk0 = 0;
}
temp_s0->unk4 = 0;
goto block_194;
case 29: /* switch 1 */
sp2C->unkC = sp2C->unkC | 0x200;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
temp_s0->unk6 = temp_s0->unk6 + 1;
goto block_194;
case 30: /* switch 1 */
if (temp_s0->unk4 >= 0x3D) {
sp2C->unkC = sp2C->unkC | 0x200;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x1D;
goto block_194;
}
break;
case 31: /* switch 1 */
if (temp_s0->unk4 >= 0x3D) {
sp2C->unkC = sp2C->unkC | 0x200;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x1E;
goto block_194;
}
break;
case 32: /* switch 1 */
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x21;
temp_s0->unkE = 0x258;
goto block_194;
case 33: /* switch 1 */
if ((temp_s0->unk4 % 60) == 0) {
sp2C->unkC = sp2C->unkC | 0x200;
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
}
}
break;
}
if (temp_s0->unk4 < 0x2710) {
temp_s0->unk4 = temp_s0->unk4 + 1;
}
if ((sp2C->unkBC & 0x80002200) != 0) {
temp_s0->unk4 = 0;
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001AC10.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8003680C(void *, ?); // extern
extern ? D_80163410;
extern ? D_801634F8;
extern u16 D_80164438;
extern s16 *D_80164590;
extern s16 D_801645B0;
void func_8001BE78(void) {
? *sp54;
? *temp_v0;
s16 temp_s2;
void *temp_s0;
void *temp_s1;
s32 phi_s5;
s16 phi_s2;
s16 *phi_s6;
? *phi_s4;
u16 *phi_s3;
s16 **phi_s7;
? *phi_v0;
s16 **phi_fp;
func_8000F628();
phi_s5 = 0;
phi_s2 = 0;
phi_s6 = &D_801645B0;
phi_s4 = &D_801634F8;
phi_s3 = &D_80164438;
phi_s7 = &D_80164550;
phi_v0 = &D_80163410;
phi_fp = &D_80164590;
do {
temp_s1 = phi_s5 + gPlayerOne;
temp_s1->unk0 = temp_s1->unk0 & 0xDFFF;
*phi_s6 = phi_s2;
phi_s4->unkC = 0.0f;
phi_s4->unk4 = 0.0f;
phi_s4->unk0 = 0.0f;
if (phi_s2 != 0) {
if (phi_s2 != 1) {
if (phi_s2 != 2) {
if (phi_s2 != 3) {
} else {
*phi_s3 = 1;
}
} else {
*phi_s3 = 6;
}
} else {
*phi_s3 = 1;
}
} else {
*phi_s3 = 6;
}
temp_s0 = (*phi_s3 * 8) + *phi_s7;
temp_s1->unk14 = temp_s0->unk0;
sp54 = phi_v0;
temp_s1->unk18 = func_802AE1C0(temp_s0->unk0, 2000.0f, temp_s0->unk4) + temp_s1->unk70;
temp_s1->unk1C = temp_s0->unk4;
temp_s1->unk2E = **phi_fp;
func_8003680C(temp_s1, 0);
temp_s2 = phi_s2 + 1;
temp_v0 = phi_v0 + 2;
temp_v0->unk-2 = 0;
phi_s5 += 0xDD8;
phi_s2 = temp_s2;
phi_s6 += 2;
phi_s4 += 0x10;
phi_s3 += 2;
phi_s7 += 4;
phi_v0 = temp_v0;
phi_fp += 4;
} while (temp_s2 != 4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001BE78.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800010CC(); // extern
? func_80014DE4(?); // extern
? func_8001BE78(); // extern
extern f32 D_800ED4B4;
extern f32 D_800ED4B8;
extern f32 D_800ED4BC;
extern f32 D_800ED4C0;
extern f32 D_800ED4C4;
extern f32 D_800ED4C8;
extern f32 D_800ED4CC;
extern f32 D_800ED4D0;
extern f32 D_800ED4D4;
extern ? D_80163418;
extern ? D_80163428;
extern ? D_80163438;
extern s16 D_8016347C;
extern s16 D_8016347E;
extern s32 D_80163480;
extern s32 D_80163484;
void func_8001C05C(void) {
f32 temp_f0;
func_800010CC();
gCurrentCourseId = 0x14;
D_8016347C = 0;
D_8016347E = 0;
D_80163480 = 0;
D_80163484 = 0;
func_8000F2DC();
func_80014DE4(0);
func_8001BE78();
temp_f0 = D_800ED4B4;
D_80163428.unk0 = temp_f0;
D_80163418.unk0 = D_800ED4B8;
D_80163438.unk0 = D_800ED4BC;
D_80163428.unk4 = temp_f0;
D_80163418.unk4 = D_800ED4C0;
D_80163438.unk4 = D_800ED4C4;
D_80163428.unk8 = temp_f0;
D_80163418.unk8 = D_800ED4C8;
D_80163438.unk8 = D_800ED4CC;
D_80163428.unkC = 0.0f;
D_80163418.unkC = D_800ED4D0;
D_80163438.unkC = D_800ED4D4;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001C05C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function func_8001C14C:
Label L8001C240 refers to a delay slot; this is currently not supported.
Please modify the assembly to work around it (e.g. copy the instruction
to all jump sources and move the label, or add a nop to the delay slot).
*/
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001C14C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80057114(?); // extern
extern u16 D_80163E2A;
void func_8001C3C4(void) {
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {
if (D_80163E2A >= 0x10) {
func_80057114(3);
return;
}
// Duplicate return node #5. Try simplifying control flow for better match
return;
}
if (gModeSelection == VERSUS) {
func_80057114();
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001C3C4.s")
#endif