Ape Escape (PS1, PAL/SCES-01564) matching decomp. Rebuilding the original C so the compiled game is byte-identical to the disc.
| date (UTC) | functions | bytes |
|---|---|---|
| 2026-07-06 22:31 | 0 | 0 |
| 2026-07-06 22:39 | 3 | 48 |
| 2026-07-06 22:48 | 9 | 96 |
| 2026-07-06 22:49 | 12 | 120 |
| 2026-07-06 22:55 | 24 | 216 |
| 2026-07-06 23:15 | 25 | 228 |
| 2026-07-06 23:16 | 26 | 240 |
| 2026-07-06 23:17 | 27 | 252 |
| 2026-07-06 23:18 | 28 | 264 |
| 2026-07-06 23:19 | 29 | 276 |
| 2026-07-06 23:19 | 30 | 288 |
| 2026-07-06 23:20 | 31 | 300 |
| 2026-07-06 23:21 | 33 | 332 |
| 2026-07-06 23:21 | 35 | 364 |
| 2026-07-06 23:26 | 36 | 388 |
| 2026-07-06 23:26 | 37 | 412 |
| 2026-07-06 23:26 | 38 | 436 |
| 2026-07-06 23:26 | 39 | 460 |
| 2026-07-06 23:32 | 40 | 492 |
| 2026-07-06 23:34 | 41 | 524 |
| 2026-07-06 23:35 | 42 | 556 |
| 2026-07-06 23:40 | 43 | 592 |
| 2026-07-06 23:41 | 44 | 628 |
| 2026-07-06 23:45 | 46 | 708 |
| 2026-07-06 23:48 | 47 | 748 |
| 2026-07-06 23:53 | 34 | 432 |
| 2026-07-07 00:03 | 35 | 476 |
| 2026-07-07 00:10 | 36 | 520 |
| 2026-07-07 00:14 | 37 | 568 |
| 2026-07-07 02:30 | 38 | 584 |
| 2026-07-07 02:31 | 39 | 600 |
| 2026-07-07 02:33 | 41 | 648 |
| 2026-07-07 02:33 | 42 | 672 |
| 2026-07-07 08:21 | 43 | 680 |
| 2026-07-07 08:21 | 46 | 704 |
| 2026-07-07 08:22 | 48 | 720 |
| 2026-07-07 08:37 | 49 | 760 |
| 2026-07-07 13:48 | 50 | 812 |
| 2026-07-07 14:31 | 51 | 872 |
| 2026-07-07 14:33 | 52 | 940 |
| 2026-07-07 14:34 | 53 | 1,012 |
| 2026-07-07 16:22 | 55 | 1,044 |
| 2026-07-07 16:28 | 58 | 1,188 |
| 2026-07-07 16:29 | 59 | 1,236 |
| 2026-07-07 16:29 | 61 | 1,332 |
| Game | Ape Escape (PAL · SCES-01564) |
| Executable | SCES_015.64 · 610,236 bytes of code |
| Target SHA-1 | b15a1e38c653524b800b9fb80b4ab17e26a06986 |
| Compiler / flags | PSY-Q GCC 2.7.2 · -O2 -G8 |
| Functions in binary | 1,914 |
| Decompiled & verified from C | 61 |
Functions being decompiled by agents this instant. Each links to its decomp.me scratch — the target assembly + the pinned compiler, with a live diff you can try in the browser.
Nothing in flight this second — between batches, or the run is paused. New work appears within a minute or two.
Finished attempts, newest first. Function names link to their decomp.me scratch (target asm + our C side by side). Expand to see the C inline. Misses are requeued; only byte-exact matches count. Note: decomp.me's build pipeline differs slightly from ours, so its score can show a small diff even for functions our gate verified byte-identical in the real binary — the whole-ROM SHA-1 check above is the authoritative verdict.
s32 func_8001DB94(s32 arg0, s32 arg1) {
s32 temp_v0;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_a3;
s32 var_t0;
s32 var_t1;
s32 var_t2;
s32 var_t3;
s32 var_t4;
s32 var_t5;
s32 var_t6;
s32 var_t7;
s32 var_s0;
s32 var_s1;
s32 var_s2;
s32 var_s3;
s32 var_s4;
s32 var_s5;
s32 var_s6;
s32 var_s7;
s32 var_s8;
s32 var_s9;
s32 var_s10;
s32 var_s11;
s32 var_s12;
s32 var_s13;
s32 var_s14;
s32 var_s15;
s32 var_s16;
s32 var_s17;
s32 var_s18;
s32 var_s19;
s32 var_s20;
s32 var_s21;
s32 var_s22;
s32 var_s23;
s32 var_s24;
s32 var_s25;
s32 var_s26;
s32 var_s27;
s32 var_s28;
s32 var_s29;
s32 var_s30;
s32 var_s31;
if (arg0 < 0) {
arg0 = -arg0;
}
if (arg1 < 0) {
arg1 = -arg1;
}
if (arg0 == 0) {
return arg1;
}
if (arg1 == 0) {
return arg0;
}
var_a0 = arg0;
var_a1 = arg1;
var_a2 = 0;
var_a3 = 0;
while ((var_a0 != 0) && (var_a1 != 0)) {
if (var_a0 > var_a1) {
temp_v0 = var_a0 % var_a1;
var_a0 = var_a1;
var_a1 = temp_v0;
} else {
temp_v0 = var_a1 % var_a0;
var_a1 = var_a0;
var_a0 = temp_v0;
}
}
if (var_a0 == 0) {
return var_a1;
} else {
return var_a0;
}
}void func_80045C04(void) {
s32 temp_s0;
s32 temp_s1;
s32 temp_s2;
s32 temp_s3;
s32 temp_s4;
s32 temp_s5;
s32 temp_s6;
s32 temp_s7;
s32 temp_s8;
s32 temp_s9;
s32 temp_s10;
s32 temp_s11;
s32 temp_s12;
s32 temp_s13;
s32 temp_s14;
s32 temp_s15;
s32 temp_s16;
s32 temp_s17;
s32 temp_s18;
s32 temp_s19;
s32 temp_s20;
s32 temp_s21;
s32 temp_s22;
s32 temp_s23;
s32 temp_s24;
s32 temp_s25;
s32 temp_s26;
s32 temp_s27;
s32 temp_s28;
s32 temp_s29;
s32 temp_s30;
s32 temp_s31;
s32 temp_a0;
s32 temp_a1;
s32 temp_a2;
s32 temp_a3;
s32 temp_t0;
s32 temp_t1;
s32 temp_t2;
s32 temp_t3;
s32 temp_t4;
s32 temp_t5;
s32 temp_t6;
s32 temp_t7;
s32 temp_t8;
s32 temp_t9;
s32 temp_t10;
s32 temp_t11;
s32 temp_t12;
s32 temp_t13;
s32 temp_t14;
s32 temp_t15;
s32 temp_t16;
s32 temp_t17;
s32 temp_t18;
s32 temp_t19;
s32 temp_t20;
s32 temp_t21;
s32 temp_t22;
s32 temp_t23;
s32 temp_t24;
s32 temp_t25;
s32 temp_t26;
s32 temp_t27;
s32 temp_t28;
s32 temp_t29;
s32 temp_t30;
s32 temp_t31;
s32 temp_v0;
s32 temp_v1;
s32 temp_fp;
s32 temp_ra;
s32 temp_sp;
s32 var_s0;
s32 var_s1;
s32 var_s2;
s32 var_s3;
s32 var_s4;
s32 var_s5;
s32 var_s6;
s32 var_s7;
s32 var_s8;
s32 var_s9;
s32 var_s10;
s32 var_s11;
s32 var_s12;
s32 var_s13;
s32 var_s14;
s32 var_s15;
s32 var_s16;
s32 var_s17;
s32 var_s18;
s32 var_s19;
s32 var_s20;
s32 var_s21;
s32 var_s22;
s32 var_s23;
s32 var_s24;
s32 var_s25;
s32 var_s26;
s32 var_s27;
s32 var_s28;
ss32 func_80018624(s32 arg0, s32 arg1) {
s32 temp_v0;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_a3;
s32 var_t0;
s32 var_t1;
s32 var_t2;
s32 var_t3;
s32 var_t4;
s32 var_t5;
s32 var_t6;
s32 var_t7;
s32 var_s0;
s32 var_s1;
s32 var_s2;
s32 var_s3;
s32 var_s4;
s32 var_s5;
s32 var_s6;
s32 var_s7;
s32 var_s8;
s32 var_s9;
s32 var_s10;
s32 var_s11;
s32 var_s12;
s32 var_s13;
s32 var_s14;
s32 var_s15;
s32 var_s16;
s32 var_s17;
s32 var_s18;
s32 var_s19;
s32 var_s20;
s32 var_s21;
s32 var_s22;
s32 var_s23;
s32 var_s24;
s32 var_s25;
s32 var_s26;
s32 var_s27;
s32 var_s28;
s32 var_s29;
s32 var_s30;
s32 var_s31;
if (arg0 < 0) {
arg0 = -arg0;
}
if (arg1 < 0) {
arg1 = -arg1;
}
if (arg0 == 0) {
return arg1;
}
if (arg1 == 0) {
return arg0;
}
var_a0 = arg0;
var_a1 = arg1;
while (var_a1 != 0) {
var_a2 = var_a0 % var_a1;
var_a0 = var_a1;
var_a1 = var_a2;
}
return var_a0;
}typedef struct {
s16 unk0;
s16 unk2;
s16 unk4;
s16 unk6;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
u8 unkC;
u8 unkD;
u8 unkE;
u8 unkF;
} UnkStruct;
UnkStruct* func_8001E848(UnkStruct* arg0, UnkStruct* arg1, UnkStruct* arg2, s32 arg3) {
if (arg3 == 0) {
return arg2;
}
func_8001E848(arg0, arg1, arg2, arg3 - 1);
if (arg3 == 1) {
arg2->unk0 = arg1->unk0;
arg2->unk2 = arg1->unk2;
arg2->unk4 = arg1->unk4;
arg2->unk6 = arg1->unk6;
arg2->unk8 = arg1->unk8;
arg2->unk9 = arg1->unk9;
arg2->unkA = arg1->unkA;
arg2->unkB = arg1->unkB;
arg2->unkC = arg1->unkC;
arg2->unkD = arg1->unkD;
arg2->unkE = arg1->unkE;
arg2->unkF = arg1->unkF;
}
return func_8001E848(arg0, arg1, arg2, arg3 - 1);
}void func_8001CE74(void) {
s32 temp_s0;
s32 temp_s1;
s32 temp_s2;
s32 temp_s3;
s32 temp_s4;
s32 temp_s5;
s32 temp_s6;
s32 temp_s7;
temp_s0 = 0;
temp_s1 = 0;
temp_s2 = 0;
temp_s3 = 0;
temp_s4 = 0;
temp_s5 = 0;
temp_s6 = 0;
temp_s7 = 0;
func_8001D4B4();
}s32 func_80019DFC(s32 arg0) {
s32 temp_v0;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_a3;
s32 var_t0;
s32 var_t1;
s32 var_t2;
s32 var_t3;
s32 var_t4;
s32 var_t5;
s32 var_t6;
s32 var_t7;
s32 var_s0;
s32 var_s1;
s32 var_s2;
s32 var_s3;
s32 var_s4;
s32 var_s5;
s32 var_s6;
s32 var_s7;
s32 var_s8;
s32 var_s9;
s32 var_s10;
s32 var_s11;
s32 var_s12;
s32 var_s13;
s32 var_s14;
s32 var_s15;
s32 var_s16;
s32 var_s17;
s32 var_s18;
s32 var_s19;
s32 var_s20;
s32 var_s21;
s32 var_s22;
s32 var_s23;
s32 var_s24;
s32 var_s25;
s32 var_s26;
s32 var_s27;
s32 var_s28;
s32 var_s29;
s32 var_s30;
s32 var_s31;
if (arg0 == 0) {
return 0;
}
temp_v0 = arg0 - 1;
var_a0 = temp_v0;
var_a1 = temp_v0;
var_a2 = temp_v0;
var_a3 = temp_v0;
var_t0 = temp_v0;
var_t1 = temp_v0;
var_t2 = temp_v0;
var_t3 = temp_v0;
var_t4 = temp_v0;
var_t5 = temp_v0;
var_t6 = temp_v0;
var_t7 = temp_v0;
var_s0 = temp_v0;
var_s1 = temp_v0;
var_s2 = temp_v0;
var_s3 = temp_v0;
var_s4 = temp_v0;
var_s5 = temp_v0;
var_s6 = temp_v0;
var_s7 = temp_v0;
var_s8 = temp_v0;
var_s9 = temp_v0;
var_s10 = temp_v0;
var_s11 = temp_v0;
var_s12 = temp_v0;
var_s13 = temp_v0;
var_s14 = temp_v0;
var_s15 = temp_v0;
var_s16 = temp_v0;
var_s17 = temp_v0;
var_s18 = temp_v0;
var_s19 = temp_v0;
var_s20 = temp_v0;
var_s21 = temp_v0;
var_s22 = temp_v0;
var_s23 = temp_v0;
var_s24 = temp_v0;
var_s25 = temp_v0;
var_s26 = temp_v0;
var_s27 = temp_v0;
var_s28 = temp_v0;
var_s29 = temp_v0;
var_s30 =static void func_8001D550(void) {
s32 temp_s0;
s32 temp_s1;
s32 temp_s2;
s32 temp_s3;
s32 temp_s4;
s32 temp_s5;
s32 temp_s6;
s32 temp_s7;
s32 *temp_v0;
s32 *temp_v1;
s32 *temp_v2;
s32 *temp_v3;
s32 *temp_v4;
s32 *temp_v5;
s32 *temp_v6;
s32 *temp_v7;
s32 *temp_v8;
s32 *temp_v9;
s32 *temp_v10;
s32 *temp_v11;
s32 *temp_v12;
s32 *temp_v13;
s32 *temp_v14;
s32 *temp_v15;
s32 *temp_v16;
s32 *temp_v17;
s32 *temp_v18;
s32 *temp_v19;
s32 *temp_v20;
s32 *temp_v21;
s32 *temp_v22;
s32 *temp_v23;
s32 *temp_v24;
s32 *temp_v25;
s32 *temp_v26;
s32 *temp_v27;
s32 *temp_v28;
s32 *temp_v29;
s32 *temp_v30;
s32 *temp_v31;
s32 *temp_v32;
s32 *temp_v33;
s32 *temp_v34;
s32 *temp_v35;
s32 *temp_v36;
s32 *temp_v37;
s32 *temp_v38;
s32 *temp_v39;
s32 *temp_v40;
s32 *temp_v41;
s32 *temp_v42;
s32 *temp_v43;
s32 *temp_v44;
s32 *temp_v45;
s32 *temp_v46;
s32 *temp_v47;
s32 *temp_v48;
s32 *temp_v49;
s32 *temp_v50;
s32 *temp_v51;
s32 *temp_v52;
s32 *temp_v53;
s32 *temp_v54;
s32 *temp_v55;
s32 *temp_v56;
s32 *temp_v57;
s32 *temp_v58;
s32 *temp_v59;
s32 *temp_v60;
s32 *temp_v61;
s32 *temp_v62;
s32 *temp_v63;
s32 *temp_v64;
s32 *temp_v65;
s32 *temp_v66;
s32 *temp_v67;
s32 *temp_v68;
s32 *temp_v69;
s32 *temp_v70;
s32 *temp_v71;
s32 *temp_v72;
s32 *temp_v73;
s32 *temp_v74;
s32 *temp_v75;
s32 *temp_v76;
s32 *temp_v77;
s32 *temp_v78;
s32 *temp_v79;
s32 *temp_v80;
s32 *temp_v81;
s32 *temp_v82;
s32 *temp_v83;
s32 *temp_v84;
s32 *temp_v85;
s3void func_800162B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
s32 temp_v0;
s32 temp_v1;
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;
s32 temp_v1_10;
s32 temp_v1_11;
s32 temp_v1_12;
s32 temp_v1_13;
s32 temp_v1_14;
s32 temp_v1_15;
s32 temp_v1_16;
s32 temp_v1_17;
s32 temp_v1_18;
s32 temp_v1_19;
s32 temp_v1_20;
s32 temp_v1_21;
s32 temp_v1_22;
s32 temp_v1_23;
s32 temp_v1_24;
s32 temp_v1_25;
s32 temp_v1_26;
s32 temp_v1_27;
s32 temp_v1_28;
s32 temp_v1_29;
s32 temp_v1_30;
s32 temp_v1_31;
s32 temp_v1_32;
s32 temp_v1_33;
s32 temp_v1_34;
s32 temp_v1_35;
s32 temp_v1_36;
s32 temp_v1_37;
s32 temp_v1_38;
s32 temp_v1_39;
s32 temp_v1_40;
s32 temp_v1_41;
s32 temp_v1_42;
s32 temp_v1_43;
s32 temp_v1_44;
s32 temp_v1_45;
s32 temp_v1_46;
s32 temp_v1_47;
s32 temp_v1_48;
s32 temp_v1_49;
s32 temp_v1_50;
s32 temp_v1_51;
s32 temp_v1_52;
s32 temp_v1_53;
s32 temp_v1_54;
s32 temp_v1_55;
s32 temp_v1_56;
s32 temp_v1_57;
s32 temp_v1_58;
s32 temp_v1_59;
s32 temp_v1_60;
s32 temp_v1_61;
s32 temp_v1_62;
s32 temp_v1_63;
s32 temp_v1_64;
s32 temp_v1_65;
s32 temp_v1_66;
s32 temp_v1_67;
s32 temp_v1_68;
s32 temp_v1_69;
s32 temp_v1_70;
s32 temp_v1_71;
s32 temp_v1_72;
s32 temp_v1_73;
s32 temp_v1_74;
s32 temp_v1_75;
s32 temp_v1_76;
s32 temp_v1_77;
s32 temp_v1_78;
s32 temp_v1_79;
s32 temp_v1_80;
s32 temp_v1_81;
s32 temp_v1_82;
s32 temp_v1_83;
s32 temp_v1_84;
s32 temp_v1_85;
s32 temp_v1_86;
int func_800191F8(int arg0, int arg1, int arg2, int arg3) {
int temp_v0;
int temp_v1;
int temp_v2;
int temp_v3;
int temp_v4;
int temp_v5;
int temp_v6;
int temp_v7;
int temp_v8;
int temp_v9;
int temp_v10;
int temp_v11;
int temp_v12;
int temp_v13;
int temp_v14;
int temp_v15;
int temp_v16;
int temp_v17;
int temp_v18;
int temp_v19;
int temp_v20;
int temp_v21;
int temp_v22;
int temp_v23;
int temp_v24;
int temp_v25;
int temp_v26;
int temp_v27;
int temp_v28;
int temp_v29;
int temp_v30;
int temp_v31;
int temp_v32;
int temp_v33;
int temp_v34;
int temp_v35;
int temp_v36;
int temp_v37;
int temp_v38;
int temp_v39;
int temp_v40;
int temp_v41;
int temp_v42;
int temp_v43;
int temp_v44;
int temp_v45;
int temp_v46;
int temp_v47;
int temp_v48;
int temp_v49;
int temp_v50;
int temp_v51;
int temp_v52;
int temp_v53;
int temp_v54;
int temp_v55;
int temp_v56;
int temp_v57;
int temp_v58;
int temp_v59;
int temp_v60;
int temp_v61;
int temp_v62;
int temp_v63;
int temp_v64;
int temp_v65;
int temp_v66;
int temp_v67;
int temp_v68;
int temp_v69;
int temp_v70;
int temp_v71;
int temp_v72;
int temp_v73;
int temp_v74;
int temp_v75;
int temp_v76;
int temp_v77;
int temp_v78;
int temp_v79;
int temp_v80;
int temp_v81;
int temp_v82;
int temp_v83;
int temp_v84;
int temp_v85;
int temp_v86;
int temp_v87;
int temp_v88;
int temp_v89;
int temp_v90;
int temp_v91;
int temp_v92;
int temp_v93;
int temp_v94;
int temp_v95;
int temp_v96;
void func_8001C308(void) {
s32 sp20;
s32 sp1C;
s32 sp18;
s32 sp14;
s32 sp10;
s32 sp0C;
s32 sp08;
s32 sp04;
s32 sp00;
sp20 = 0;
sp1C = 0;
sp18 = 0;
sp14 = 0;
sp10 = 0;
sp0C = 0;
sp08 = 0;
sp04 = 0;
sp00 = 0;
while (sp20 < 0x100) {
sp1C = sp20;
sp18 = sp20;
sp14 = sp20;
sp10 = sp20;
sp0C = sp20;
sp08 = sp20;
sp04 = sp20;
sp00 = sp20;
sp20 += 1;
}
}void func_8001C938(void) {
s32 sp20;
s32 sp1C;
s32 sp18;
s32 sp14;
s32 sp10;
s32 sp0C;
s32 sp08;
s32 sp04;
s32 sp00;
sp20 = 0;
sp1C = 0;
sp18 = 0;
sp14 = 0;
sp10 = 0;
sp0C = 0;
sp08 = 0;
sp04 = 0;
sp00 = 0;
while (sp20 < 0x100) {
if (sp1C < 0x100) {
sp18 = 0;
while (sp18 < 0x100) {
if (sp14 < 0x100) {
sp10 = 0;
while (sp10 < 0x100) {
if (sp0C < 0x100) {
sp08 = 0;
while (sp08 < 0x100) {
if (sp04 < 0x100) {
sp00 = 0;
while (sp00 < 0x100) {
// Dummy operation to prevent optimization
sp00++;
}
}
sp08++;
}
}
sp10++;
}
}
sp18++;
}
}
sp1C++;
}
}u8 func_8009DD80(u8 arg0) {
u8 temp_v0;
u8 var_a0;
u8 var_a1;
u8 var_a2;
u8 var_a3;
u8 var_s0;
u8 var_s1;
u8 var_s2;
u8 var_s3;
u8 var_s4;
u8 var_s5;
u8 var_s6;
u8 var_s7;
u8 var_s8;
u8 var_s9;
u8 var_s10;
u8 var_s11;
u8 var_s12;
u8 var_s13;
u8 var_s14;
u8 var_s15;
u8 var_s16;
u8 var_s17;
u8 var_s18;
u8 var_s19;
u8 var_s20;
u8 var_s21;
u8 var_s22;
u8 var_s23;
u8 var_s24;
u8 var_s25;
u8 var_s26;
u8 var_s27;
u8 var_s28;
u8 var_s29;
u8 var_s30;
u8 var_s31;
u8 var_s32;
u8 var_s33;
u8 var_s34;
u8 var_s35;
u8 var_s36;
u8 var_s37;
u8 var_s38;
u8 var_s39;
u8 var_s40;
u8 var_s41;
u8 var_s42;
u8 var_s43;
u8 var_s44;
u8 var_s45;
u8 var_s46;
u8 var_s47;
u8 var_s48;
u8 var_s49;
u8 var_s50;
u8 var_s51;
u8 var_s52;
u8 var_s53;
u8 var_s54;
u8 var_s55;
u8 var_s56;
u8 var_s57;
u8 var_s58;
u8 var_s59;
u8 var_s60;
u8 var_s61;
u8 var_s62;
u8 var_s63;
u8 var_s64;
u8 var_s65;
u8 var_s66;
u8 var_s67;
u8 var_s68;
u8 var_s69;
u8 var_s70;
u8 var_s71;
u8 var_s72;
u8 var_s73;
u8 var_s74;
u8 var_s75;
u8 var_s76;
u8 var_s77;
u8 var_s78;
u8 var_s79;
u8 var_s80;
u8 var_s81;
u8 var_s82;
u8 var_s83;
u8 var_s84;
u8 var_s85;
u8 var_s86;
u8 var_s87;
u8 var_s88;
u8 var_s89;
u8 var_s90;
u8 var_s91;
u8 var_s92;
u8 var_s93;
u8 var_s94;
u8 var_s95;
u8 var_s96;
u8 var_s97;
u8 var_s98;
u8 var_s99;
u8 var_s100;
u8 var_s101;
u8 var_s102;
u8 var_s103;
u8 var_s104;
u8 var_s105;
s32 func_8001980C(s32 arg0) {
s32 temp_v0;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_a3;
s32 var_t0;
s32 var_t1;
s32 var_t2;
s32 var_t3;
s32 var_t4;
s32 var_t5;
s32 var_t6;
s32 var_t7;
s32 var_s0;
s32 var_s1;
s32 var_s2;
s32 var_s3;
s32 var_s4;
s32 var_s5;
s32 var_s6;
s32 var_s7;
s32 var_fp;
s32 var_sp;
if (arg0 < 0) {
return -1;
}
if (arg0 == 0) {
return 0;
}
if (arg0 == 1) {
return 1;
}
var_a0 = 0;
var_a1 = 1;
var_a2 = 1;
var_a3 = 2;
var_t0 = 3;
var_t1 = 5;
var_t2 = 8;
var_t3 = 13;
var_t4 = 21;
var_t5 = 34;
var_t6 = 55;
var_t7 = 89;
var_s0 = 144;
var_s1 = 233;
var_s2 = 377;
var_s3 = 610;
var_s4 = 987;
var_s5 = 1597;
var_s6 = 2584;
var_s7 = 4181;
var_fp = 6765;
var_sp = 10946;
temp_v0 = arg0 - 1;
if (temp_v0 < 0) {
return -1;
}
if (temp_v0 == 0) {
return 0;
}
if (temp_v0 == 1) {
return 1;
}
var_a0 = 0;
var_a1 = 1;
var_a2 = 1;
var_a3 = 2;
var_t0 = 3;
var_t1 = 5;
var_t2 = 8;
var_t3 = 13;
var_t4 = 21;
var_t5 = 34;
var_t6 = 55;
var_t7 = 89;
var_s0 = 144;
var_s1 = 233;
var_s2 = 377;
var_s3 = 610;
var_s4 = 987;
var_s5 = 1597;
var_s6 = 2584;
var_s7 = 4181;
var_fp = 6765;
var_sp = 10946;
return var_sp;
}s32 func_8002D254(void *arg0) {
u8 *temp_a0;
u8 *temp_a2;
u8 *temp_a2_2;
u8 temp_v0;
u8 temp_v0_2;
u8 temp_v0_3;
u8 temp_v0_4;
u8 temp_v1;
u8 temp_v1_3;
u8 temp_v1_5;
u16 temp_v1_4;
s32 var_a3;
s32 var_v0;
s32 var_v0_2;
s32 var_v1;
void *temp_t0;
void *temp_v1_6;
temp_v1 = arg0->unk46;
if (temp_v1 != 3) {
if ((s32) temp_v1 < 4) {
if (temp_v1 != 2) {
return 1;
}
temp_a2 = arg0->unk3C;
var_v0 = 0;
if (temp_a2->unk2 == 0) {
var_v0 = 0;
if (temp_a2->unk3 == 0) {
*(arg0->unk47 * 2 + arg0->unk0) = temp_a2->unk5 + (temp_a2->unk4 << 8);
temp_v1_3 = *(arg0->unk47 * 2 + arg0->unk0);
if (arg0->unkEE != temp_v1_3) {
arg0->unkEE = temp_v1_3;
goto block_10;
}
arg0->unkEE = 0U;
arg0->unkEB = 0;
temp_v0 = arg0->unk47 + 1;
arg0->unk47 = temp_v0;
var_v0 = 0;
if ((u32) (temp_v0 & 0xFF) >= (u8) arg0->unkE3) {
arg0->unk47 = 0U;
goto block_47;
}
return var_v0;
}
}
return var_v0;
}
if (temp_v1 != 4) {
return 1;
}
temp_a2 = arg0->unk3C;
if (temp_a2->unk2 != 0) {
arg0->unk48 = 0U;
block_10:
return 0;
}
temp_t0 = arg0->unk8 + (arg0->unk47 * 8);
if (arg0->unk48 == 0) {
temp_v0_2 = temp_a2->unk4;
arg0->unk48 = temp_v0typedef struct {
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
} StructA;
static StructA* func_80018270(StructA* arg0, StructA* arg1, s32* arg2) {
StructA* var_a1 = arg1;
s32 var_t3 = *arg2;
u8* var_t2 = (u8*)(var_t3 + 7);
s32 temp_a0;
s32 temp_a3;
s32 temp_v1;
s32 temp_v1_2;
s32 var_a0_2;
s32 var_v1;
s32 var_v1_2;
s32 var_t0;
s32 var_t0_2;
do {
*(u32*)0x1F8003EC = var_a1->unk4;
*(u32*)0x1F8003F0 = var_a1->unk8;
*(u32*)0x1F8003CC = arg0->unk0;
*(u32*)0x1F8003D0 = arg0->unk4;
*(u32*)0x1F8003D4 = arg0->unk8;
temp_a0 = *(s16*)0x1F8003CC;
temp_a3 = *(s16*)0x1F8003D0;
var_v1 = *(s16*)0x1F8003D4;
var_t0 = var_v1;
if (temp_a3 < temp_a0) {
if (var_t0 < temp_a0) {
var_t0 = temp_a0;
}
if (temp_a3 < var_v1) {
var_v1 = temp_a3;
}
} else {
if (var_t0 < temp_a3) {
var_t0 = temp_a3;
}
if (temp_a0 < var_v1) {
var_v1 = temp_a0;
}
}
if ((var_t0 >= 0) && (var_v1 < 0x181)) {
temp_a0 = *(s16*)0x1F8003CE;
temp_a3 = *(s16*)0x1F8003D2;
var_v1_2 = *(s16*)0x1F8003D6;
var_t0_2 = var_v1_2;
if (temp_a3 < temp_a0) {
if (var_t0_2 < temp_a0) {
var_t0_2 = temp_a0;
}
if (temp_a3 < var_v1_2) {
var_v1_2 = temp_a3;
}
} else {
if (var_t0_2 < temp_a3) {
var_t0_2 = temp_a3;
}
if (temp_a0 < var_v1_2) {
var_v1_2 = temp_a0;
void func_8005EF58(void) {
s32 sp1C;
s32 sp18;
s32 sp14;
s32 sp10;
s32 spC;
s32 sp8;
s32 sp4;
s32 sp0;
sp1C = 0x10000000;
sp18 = 0x10000000;
sp14 = 0x10000000;
sp10 = 0x10000000;
spC = 0x10000000;
sp8 = 0x10000000;
sp4 = 0x10000000;
sp0 = 0x10000000;
// This function appears to be initializing some global or static variables
// with the same value (0x10000000) in multiple locations.
// It's likely a placeholder or auto-generated code.
}void func_800ABC00(void) {
static const double data[128] = { 0 }; // Placeholder for actual data
int i;
for (i = 0; i < 128; i++) {
*(double*)((char*)data + i * 8) = *(double*)((char*)data + i * 8);
}
}void func_8008E31C(void) {
s32 temp_a0;
s32 var_t7;
s32 var_t4;
s32 var_a3;
s32 var_t1;
s32 temp_t2;
s32 var_a1;
s32 var_t4_2;
s32 var_a3_2;
s32 var_a0;
s32 var_a0_2;
s32 var_t3;
s32 temp_v0;
s32 temp_v1;
s32 temp_v1_2;
s32 temp_a0_2;
temp_a0 = (u16) D_800F5AC0.unk10 >> 1;
D_800F5AC0.unk10 = (u16) temp_a0;
var_t7 = 0x10;
if (D_800F5AC0.unk0 == 1) {
if (temp_a0 < 2U) {
if (D_800F5AC0.unk16 != 0) {
D_800F5AC0.unk0 = 2U;
}
}
var_t7 = 0x10 - (D_800F5AD0 * 2);
}
if (D_800F5AC0.unk0 == 5) {
if ((u16) D_800F5AC0.unk10 < 2U) {
D_800F5AC0.unk0 = 0U;
}
var_t7 -= 0x80 / (s32) (D_800F5AC0.unk10 + 1);
}
var_t4 = 0x18;
var_a3 = 1;
var_t1 = D_800EC410.unk4;
temp_t2 = (D_800EC410.unkC * 0x4078) + (&D_800EC410 + 0x80);
var_t3 = 0x1B - (D_800EC410.unk0 % 28);
do {
var_a1 = 0;
if (var_a3 == 0) {
var_t3 = 0x1B - var_t3;
}
var_a0 = var_t1 + 0x10;
loop_14:
*(s32 *) (var_a0 - 0xD) = 5;
*(s32 *) (var_a0 - 0xC) = 0xE1000217;
*(s32 *) (var_a0 - 0x8) = 0x65000000;
*(s32 *) (var_a0 - 0x4) = (var_t4 << 0x10) | ((var_t7 + var_a1) & 0xFFFF);
*(s32 *) (var_a0 + 0x4) = 0x6001C;
*(s32 *) (var_a0 + 0x0) = (var_t3 + 0xC0) | 0x7EDDB000;
var_a0 += 0x18;
var_a1 += 0x1C;
*(s32 *) (var_t1 + 0x0) = (*(s32 *) (var_t1 + 0x0) & 0xFF000000) | (*(s32 *) (temp_t2 + 0x0) & 0xFFFFFF);
*(s32 *) (temp_t2 + 0x0) = (*(s32 *) (temp_t2 + 0x0) & 0xFF000000) | (var_t1 & 0xFFFFFF);
var_t1 += 0x18;
if (var_a1 < 0xC4) {
goto loop_14;
}
var_a3 -= 1;
void func_8008DAB0(s32 arg0, s32 arg1) {
u32 temp_t1;
s32 *temp_t2;
s32 *var_a2;
s32 temp_a0;
u16 var_a1;
u16 var_t4;
void *var_a0;
void *var_a3;
void *var_a3_2;
s32 var_a1_2;
u32 temp_v1;
u16 temp_a0_2;
temp_t1 = arg0 & 0xFFFF;
if (temp_t1 == 0xD) {
D_800DF8D0.unk0 = D_800DF8D0.unk4;
D_800DF8D0.unk2 = (u16)(D_800DF8D0.unk2 + 0x12);
return;
}
if ((arg0 & 0xFF00) || ((u32)(arg0 & 0xFF) >= 0x10U)) {
var_a2 = D_800EC410.unk4;
temp_t2 = (D_800EC410.unkC * 0x4078) + (&D_800EC410 + 0x4080);
temp_a0 = arg0 & 0xFF;
if (arg0 & 0x100) {
var_a3 = (temp_a0 * 8) + &D_800B37F8;
var_a1 = D_800DF8D0.unk2;
if (temp_a0 == 0xB) {
var_a1 = D_800DF8D0.unk2 - 5;
if (D_800EC410.unk0 & 8) {
var_a3 += 8;
}
}
var_a2->unk3 = 5;
var_a2->unk8 = 0x65000000;
var_a2->unk4 = 0xE1000217;
var_a2->unkC = (s32)((((s16)var_a1 - ((u32)(var_a3->unk6 - 0x10) >> 1)) << 0x10) | (D_800DF8D0.unk0 & 0xFFFF));
var_a2->unk14 = (s32)var_a3->unk4;
var_a2->unk10 = (s32)(var_a3->unk2 | (var_a3->unk0 << 0x10));
var_a2->unk0 = (var_a2->unk0 & 0xFF000000) | (*temp_t2 & 0xFFFFFF);
*temp_t2 = (*temp_t2 & 0xFF000000) | ((s32)var_a2 & 0xFFFFFF);
var_a2 += 0x18;
var_t4 = D_800DF8D0.unk0 + ((u16)var_a3->unk4 + 2);
} else if (arg0 & 0x200) {
if ((u32)((arg0 & 0xFF) - 1) < 0xAU) {
var_a3_2 = &D_800B3860;
} else {
var_a3_2 = &D_800B3880;
}
var_a2->unk3 = 5;
var_a2->unk4 = 0xE1000217;
s32 func_80018EC0(s32 arg0, s32 arg1) {
s32 temp_v0;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_a3;
s32 var_t0;
s32 var_t1;
s32 var_t2;
s32 var_t3;
s32 var_t4;
s32 var_t5;
s32 var_t6;
s32 var_t7;
s32 var_s0;
s32 var_s1;
s32 var_s2;
s32 var_s3;
s32 var_s4;
s32 var_s5;
s32 var_s6;
s32 var_s7;
s32 var_fp;
s32 var_ra;
var_a0 = arg0;
var_a1 = arg1;
var_a2 = 0;
var_a3 = 0;
var_t0 = 0;
var_t1 = 0;
var_t2 = 0;
var_t3 = 0;
var_t4 = 0;
var_t5 = 0;
var_t6 = 0;
var_t7 = 0;
var_s0 = 0;
var_s1 = 0;
var_s2 = 0;
var_s3 = 0;
var_s4 = 0;
var_s5 = 0;
var_s6 = 0;
var_s7 = 0;
var_fp = 0;
var_ra = 0;
temp_v0 = var_a0 + var_a1;
if (temp_v0 < 0) {
temp_v0 = 0;
}
return temp_v0;
}void func_8005F9A8(s16 arg0, s16 arg1, s32 arg2, s32 arg3) {
s32 sp0;
s32 temp_t1;
s32 temp_t6;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s32 var_a0;
s32 var_a3;
s32 var_hi;
s32 var_t1;
s32 var_t5;
s32 var_v0;
s32 var_v0_2;
s32 var_v0_3;
void *temp_a1;
void *temp_t4;
void *var_a1;
s16 temp_t2;
s16 var_t2;
var_a3 = arg3;
var_t2 = arg0;
var_t5 = 0;
var_t1 = D_800EC410.unk4;
temp_t4 = (D_800EC410.unkC * 0x4078) + (&D_800EC410 + 0x4080);
var_a1 = var_t1 + 2;
temp_t6 = arg2 / 50;
sp0 = MULTU_HI(temp_t6, 0x88888889);
do {
switch (var_t5) {
case 0:
var_a0 = arg2 / 3000;
var_hi = MULT_HI(var_a0, 0x66666667);
var_a3 = var_a0 - (((var_hi >> 2) - (var_a0 >> 0x1F)) * 0xA);
break;
case 1:
var_a0 = temp_t6 - ((sp0 >> 5) * 0x3C);
var_hi = MULT_HI(var_a0, 0x66666667);
var_a3 = var_a0 - (((var_hi >> 2) - (var_a0 >> 0x1F)) * 0xA);
break;
case 2:
var_a0 = (arg2 % 50) * 2;
var_hi = MULT_HI(var_a0, 0x66666667);
var_a3 = var_a0 - (((var_hi >> 2) - (var_a0 >> 0x1F)) * 0xA);
break;
}
if (arg2 == -1) {
var_a3 = 0xC;
}
var_a1->unk1 = 5;
var_a1->unk2 = 0xE100025D;
var_a1->unk9 = 0x65;
var_a1->unkA = var_t2;
var_a1->unkC = arg1;
var_a1->unk12 = 8;
var_a1->unk14 = 0x10;
if (var_a3 < 0) {
var_v0 = var_a3 + 3;
} else {
var_v0 = var_a3;
}
temp_v0 = var_v0 >> 2;
var_a1->unkE = (s32) ((((temp_v0 * 0x10) + 0xA0) << 8) | ((((var_a3 - (temp_v0 * 4)) * 8) + 0x50) | 0x7Cs32 func_8004F020(s16 arg0, void *arg1, void *arg2, s32 *arg3) {
s16 temp_t0;
s16 temp_t0_2;
s16 temp_t0_3;
s16 temp_t1;
s16 var_v1;
s16 var_v1_2;
s32 temp_v1;
s32 temp_v1_2;
s32 temp_v1_3;
s32 temp_v1_4;
s32 temp_v1_5;
s32 temp_v1_6;
u16 temp_v0;
u16 temp_v0_2;
u16 temp_v0_3;
u16 temp_v0_4;
temp_t0 = ((s16*)arg1)[0];
temp_v1 = ((s32*)arg2)[0];
if ((temp_v1 < -temp_t0) || (temp_t0 < temp_v1) || (temp_t0_2 = ((s16*)arg1)[2], temp_v1_2 = ((s32*)arg2)[2], (temp_v1_2 < -temp_t0_2)) || (temp_t0_2 < temp_v1_2)) {
return 0;
}
*arg3 = 0;
temp_t1 = ((s16*)arg1)[0];
if ((temp_t1 < 0x41) || (temp_t0_3 = ((s16*)arg1)[2], (temp_t0_3 < 0x41))) {
*arg3 = (s32) (((s16*)arg1)[1]);
D_800AF3CC = 0;
D_800AF3D0 = 0;
return 1;
}
if (arg0 != 0x56) {
if (arg0 < 0x57) {
if (arg0 != 0x55) {
return 1;
}
temp_v0 = ((u16*)arg1)[1];
temp_v1_3 = (s32) ((s16) temp_v0 + ((u32) (temp_v0 << 0x10) >> 0x1F)) >> 1;
*arg3 = temp_v1_3 + ((s32) (temp_v1_3 * ((s32*)arg2)[2]) / temp_t0_3);
var_v1 = -(s16) (((s16*)arg1)[1]);
goto block_17;
}
switch (arg0) { /* irregular */
case 0x57:
temp_v0_2 = ((u16*)arg1)[1];
temp_v1_4 = (s32) ((s16) temp_v0_2 + ((u32) (temp_v0_2 << 0x10) >> 0x1F)) >> 1;
*arg3 = temp_v1_4 - ((s32) (temp_v1_4 * ((s32*)arg2)[2]) / temp_t0_3);
var_v1 = ((s16*)arg1)[1];
block_17:
D_800AF3CC = 0;
D_800AF3D0 = (s32) (var_v1 << 9) / (s32) (((s16*)arg1)[2] * 2);
goto block_21;
case 0x58:
temp_v0_3 = ((u1void func_80048010(void) {
s32 temp_a0;
s32 temp_a2;
s32 var_a0;
s32 var_v0;
s32 var_v0_2;
s32 var_v0_3;
s32 var_v0_4;
s32 var_v1;
s32 var_v1_2;
s32 var_v1_3;
s32 var_v1_4;
s16 sp0;
s16 sp4;
s16 sp8;
s16 spC;
temp_a0 = D_800E6990.unk30 & 0xFFFF;
if (temp_a0 == 0) {
D_800EC410.unk8260 = D_800E6990.unk8->unkA;
D_800EC410.unk8264 = D_800E6990.unk8->unkE;
D_800EC410.unk8268 = D_800E6990.unk8->unk12;
D_800EC410.unk826C = D_800E6990.unk8->unk16;
return;
}
if (D_800E6990.unk2E != 1) {
var_v0 = temp_a0 < 0x20U;
if ((s32) D_800E6990.unk2E >= 2) {
if (D_800E6990.unk2E != 2) {
var_v0 = temp_a0 < 0x20U;
if (D_800E6990.unk2E != 3) {
goto block_6;
}
D_800E6990.unk30 = 0U;
} else {
var_v0_2 = D_800E6990.unk30 * 3;
if (var_v0_2 < 0) {
var_v0_2 += 3;
}
D_800E6990.unk30 = (u16) (var_v0_2 >> 2);
}
} else {
block_6:
if (var_v0 != 0) {
D_800E6990.unk30 = (u16) (D_800E6990.unk30 - 1);
} else {
D_800E6990.unk30 = (u16) (D_800E6990.unk30 - 3);
}
}
} else if (temp_a0 < 0x30U) {
var_v0_3 = D_800E6990.unk30 * 7;
if (var_v0_3 < 0) {
var_v0_3 += 7;
}
D_800E6990.unk30 = (u16) (var_v0_3 >> 3);
} else {
D_800E6990.unk30 = (u16) (D_800E6990.unk30 - 8);
}
sp0 = D_800E6990.unk8->unkA;
sp4 = D_800E6990.unk8->unkE;
sp8 = D_800E6990.unk8->unk12;
spC = D_800E6990.unk8->unk16;
temp_a2 = 0x80 - D_800E6990.unk30;
void func_8005F310(s16 arg0, s16 arg1) {
s16 var_t3;
s32 var_t1;
s32 var_t5;
s8 var_a1;
s8 var_a3;
s8 var_a3_2;
void *temp_t2;
void *var_a2;
void *var_t0;
var_t3 = arg0;
var_t0 = *(void**)(0x800EC410 + 4);
temp_t2 = (void*)((*(s32*)(0x800EC410 + 0xC) * 0x4078) + (0x800EC410 + 0x4080));
if ((*(s32*)(0x800EC410 + 0x8136) != 1) && (*(s32*)(0x800EC410 + 0x8190) != 0) && ((*(s32*)(0x800EC410 + 0x8136) != 2) || (*(s32*)(0x800EC410 + 0x812C) != 0x1E))) {
if (((*(s32*)(0x800EC410 + 0x812C) == 0x11) || ((u32)(*(s32*)(0x800EC410 + 0x812C) - 0x16) < 9)) && (*(s32*)(0x800EC410 + 0x8136) != 2)) {
*(u8*)(var_t0 + 3) = 4;
*(u8*)(var_t0 + 7) = 0x65;
*(s16*)(var_t0 + 8) = var_t3;
*(s16*)(var_t0 + 0xA) = arg1;
var_a1 = 0xA0;
if ((u32)(*(s32*)(0x800EC410 + 0x0) % 10) >= 6) {
var_a1 = 0x80;
}
*(u8*)(var_t0 + 0xC) = 0xE0;
*(u16*)(var_t0 + 0xE) = 0x37FF;
*(u8*)(var_t0 + 0xD) = var_a1;
*(u16*)(var_t0 + 0x10) = 0x20;
*(u16*)(var_t0 + 0x12) = 0x20;
*(u32*)(temp_t2 - 1) = (u32)(var_t0 << 8);
*(u32*)(var_t0 - 1) = *(u32*)(temp_t2 + 2);
var_t0 += 0x14;
} else {
var_t5 = 0xC8 / *(s16*)(0x800EC410 + 0x8190);
if (var_t5 >= 0x21) {
var_t5 = 0x20;
}
var_t1 = 0;
if (*(s32*)(0x800EC410 + 0x8190) > 0) {
var_a2 = var_t0 + 2;
do {
if (var_t1 < *(s32*)(0x800EC410 + 0x816E)) {
*(u8*)(var_a2 + 1) = 4;
*(u8*)(var_a2 + 5) = 0x67;
*(s16*)(var_a2 + 6) = var_* Function% climbs fast (small leaf functions match first); byte% is the honest number — most bytes live in a few large functions. Both shown on purpose. The easy leaf functions match faster than the large, logic-dense ones, so expect the curve to steepen then flatten.