mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-05 17:03:23 -04:00
phase-36: T7 agent c42 — func_80186A8C and func_80182058 closed through cross-jump readings (10 bodies); related.txt requires evidence before calling a same-name body a variant (R22 218/218)
This commit is contained in:
@@ -4283,15 +4283,11 @@ void func_8017F4DC(s32 a0) {
|
||||
s32 t;
|
||||
s32 r;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
r = ((s32 (*)(s32))func_8012CBA4)(a0);
|
||||
if (r & 0x8000) {
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
@@ -4328,15 +4324,11 @@ void func_8017F4DC(s32 a0) {
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) =
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) + d;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
if ((((s32 (*)(s32))func_8012CBA4)(a0) & 0x2000) == 0) {
|
||||
func_8012ADE4((u8 *)a0);
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
|
||||
@@ -7329,11 +7329,6 @@ s32 func_80182058(void *a0)
|
||||
u16 st;
|
||||
|
||||
if (func_8012BD14(*(s32 *)((s32)a0 + 0x64)) > 0x4000) {
|
||||
/* LOAD-BEARING zero-byte cross-jump barrier (cookbook §5a).
|
||||
* Without it gcc's find_cross_jump merges this `move v0,0; j epi`
|
||||
* tail with the identical case-2 failure tail -> 58 ins instead of
|
||||
* 60, and the case-2 `beq` then loses its delay-slot fill. */
|
||||
__asm__ __volatile__(""); // !FAKE: barrier — NEEDED DIFFERS (P36 rung B tus7)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7344,13 +7339,13 @@ s32 func_80182058(void *a0)
|
||||
*(s16 *)((s32)p + 0x2) = 8;
|
||||
break;
|
||||
case 2:
|
||||
if (*(u16 *)((s32)p + 0x34) != 1) {
|
||||
return 0;
|
||||
if (*(u16 *)((s32)p + 0x34) == 1) {
|
||||
goto hit;
|
||||
}
|
||||
goto hit;
|
||||
goto fail;
|
||||
case 4:
|
||||
if (*(u16 *)((s32)p + 0x34) != 0) {
|
||||
return 0;
|
||||
goto fail;
|
||||
}
|
||||
hit:
|
||||
D_801EEAF0 = st;
|
||||
@@ -7358,6 +7353,9 @@ s32 func_80182058(void *a0)
|
||||
*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0x2) = 10;
|
||||
break;
|
||||
default:
|
||||
fail: /* the case-2/case-4 failures share this one `return 0`: a return
|
||||
* falling out of a conditional (as the first one does) is what
|
||||
* jump2's cross-jump would merge the early return into */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8428,11 +8426,6 @@ s32 func_801834C0(void *a0)
|
||||
u16 st;
|
||||
|
||||
if (func_8012BD14(*(s32 *)((s32)a0 + 0x64)) > 0x4000) {
|
||||
/* LOAD-BEARING zero-byte cross-jump barrier (cookbook §5a).
|
||||
* Without it gcc's find_cross_jump merges this `move v0,0; j epi`
|
||||
* tail with the identical case-2 failure tail -> 58 ins instead of
|
||||
* 60, and the case-2 `beq` then loses its delay-slot fill. */
|
||||
__asm__ __volatile__(""); // !FAKE: barrier — NEEDED DIFFERS (P36 rung B tus7)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8443,13 +8436,13 @@ s32 func_801834C0(void *a0)
|
||||
*(s16 *)((s32)p + 0x2) = 8;
|
||||
break;
|
||||
case 2:
|
||||
if (*(u16 *)((s32)p + 0x34) != 1) {
|
||||
return 0;
|
||||
if (*(u16 *)((s32)p + 0x34) == 1) {
|
||||
goto hit;
|
||||
}
|
||||
goto hit;
|
||||
goto fail;
|
||||
case 4:
|
||||
if (*(u16 *)((s32)p + 0x34) != 0) {
|
||||
return 0;
|
||||
goto fail;
|
||||
}
|
||||
hit:
|
||||
D_801EEB00 = st;
|
||||
@@ -8457,6 +8450,9 @@ s32 func_801834C0(void *a0)
|
||||
*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0x2) = 10;
|
||||
break;
|
||||
default:
|
||||
fail: /* the case-2/case-4 failures share this one `return 0`: a return
|
||||
* falling out of a conditional (as the first one does) is what
|
||||
* jump2's cross-jump would merge the early return into */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6876,15 +6876,11 @@ void func_80185BE4(s32 a0) {
|
||||
s32 t;
|
||||
s32 r;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
r = ((s32 (*)(s32))func_8012CBA4)(a0);
|
||||
if (r & 0x8000) {
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
@@ -6921,15 +6917,11 @@ void func_80185BE4(s32 a0) {
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) =
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) + d;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
if ((((s32 (*)(s32))func_8012CBA4)(a0) & 0x2000) == 0) {
|
||||
func_8012ADE4((u8 *)a0);
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
|
||||
@@ -5210,15 +5210,11 @@ void func_80186A8C(s32 a0) {
|
||||
s32 t;
|
||||
s32 r;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
r = ((s32 (*)(s32))func_8012CBA4)(a0);
|
||||
if (r & 0x8000) {
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
@@ -5255,15 +5251,11 @@ void func_80186A8C(s32 a0) {
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) =
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) + d;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
if ((((s32 (*)(s32))func_8012CBA4)(a0) & 0x2000) == 0) {
|
||||
func_8012ADE4((u8 *)a0);
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
|
||||
@@ -5093,15 +5093,11 @@ void func_80180864(s32 a0) {
|
||||
s32 t;
|
||||
s32 r;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
r = ((s32 (*)(s32))func_8012CBA4)(a0);
|
||||
if (r & 0x8000) {
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
@@ -5138,15 +5134,11 @@ void func_80180864(s32 a0) {
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) =
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) + d;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
if ((((s32 (*)(s32))func_8012CBA4)(a0) & 0x2000) == 0) {
|
||||
func_8012ADE4((u8 *)a0);
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
|
||||
@@ -4379,15 +4379,11 @@ void func_8018106C(s32 a0) {
|
||||
s32 t;
|
||||
s32 r;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
r = ((s32 (*)(s32))func_8012CBA4)(a0);
|
||||
if (r & 0x8000) {
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
@@ -4424,15 +4420,11 @@ void func_8018106C(s32 a0) {
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) =
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x12) + d;
|
||||
if (ang >= 0) {
|
||||
t = -(ang << 4);
|
||||
t = -(ang << 4) - 0x4000;
|
||||
} else {
|
||||
t = ang << 4;
|
||||
}
|
||||
{
|
||||
register s32 av __asm__("$5"); // !FAKE: pin $5 — NEEDED DIFFERS (P36 rung B tus9)
|
||||
av = t - 0x4000;
|
||||
func_8012B178(a0, av);
|
||||
t = (ang << 4) - 0x4000;
|
||||
}
|
||||
func_8012B178(a0, t);
|
||||
if ((((s32 (*)(s32))func_8012CBA4)(a0) & 0x2000) == 0) {
|
||||
func_8012ADE4((u8 *)a0);
|
||||
*(u16 *)(a0 + 0x34) = 2;
|
||||
|
||||
@@ -7371,11 +7371,6 @@ s32 func_801825BC(void *a0)
|
||||
u16 st;
|
||||
|
||||
if (func_8012BD14(*(s32 *)((s32)a0 + 0x64)) > 0x4000) {
|
||||
/* LOAD-BEARING zero-byte cross-jump barrier (cookbook §5a).
|
||||
* Without it gcc's find_cross_jump merges this `move v0,0; j epi`
|
||||
* tail with the identical case-2 failure tail -> 58 ins instead of
|
||||
* 60, and the case-2 `beq` then loses its delay-slot fill. */
|
||||
__asm__ __volatile__(""); // !FAKE: barrier — NEEDED DIFFERS (P36 rung B tus7)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -7386,13 +7381,13 @@ s32 func_801825BC(void *a0)
|
||||
*(s16 *)((s32)p + 0x2) = 8;
|
||||
break;
|
||||
case 2:
|
||||
if (*(u16 *)((s32)p + 0x34) != 1) {
|
||||
return 0;
|
||||
if (*(u16 *)((s32)p + 0x34) == 1) {
|
||||
goto hit;
|
||||
}
|
||||
goto hit;
|
||||
goto fail;
|
||||
case 4:
|
||||
if (*(u16 *)((s32)p + 0x34) != 0) {
|
||||
return 0;
|
||||
goto fail;
|
||||
}
|
||||
hit:
|
||||
D_801E7020 = st;
|
||||
@@ -7400,6 +7395,9 @@ s32 func_801825BC(void *a0)
|
||||
*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0x2) = 10;
|
||||
break;
|
||||
default:
|
||||
fail: /* the case-2/case-4 failures share this one `return 0`: a return
|
||||
* falling out of a conditional (as the first one does) is what
|
||||
* jump2's cross-jump would merge the early return into */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5411,11 +5411,6 @@ s32 func_8017FB10(void *a0)
|
||||
u16 st;
|
||||
|
||||
if (func_8012BD14(*(s32 *)((s32)a0 + 0x64)) > 0x4000) {
|
||||
/* LOAD-BEARING zero-byte cross-jump barrier (cookbook §5a).
|
||||
* Without it gcc's find_cross_jump merges this `move v0,0; j epi`
|
||||
* tail with the identical case-2 failure tail -> 58 ins instead of
|
||||
* 60, and the case-2 `beq` then loses its delay-slot fill. */
|
||||
__asm__ __volatile__(""); // !FAKE: barrier — NEEDED DIFFERS (P36 rung B tus7)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5426,13 +5421,13 @@ s32 func_8017FB10(void *a0)
|
||||
*(s16 *)((s32)p + 0x2) = 8;
|
||||
break;
|
||||
case 2:
|
||||
if (*(u16 *)((s32)p + 0x34) != 1) {
|
||||
return 0;
|
||||
if (*(u16 *)((s32)p + 0x34) == 1) {
|
||||
goto hit;
|
||||
}
|
||||
goto hit;
|
||||
goto fail;
|
||||
case 4:
|
||||
if (*(u16 *)((s32)p + 0x34) != 0) {
|
||||
return 0;
|
||||
goto fail;
|
||||
}
|
||||
hit:
|
||||
D_801ECE68 = st;
|
||||
@@ -5440,6 +5435,9 @@ s32 func_8017FB10(void *a0)
|
||||
*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0x2) = 10;
|
||||
break;
|
||||
default:
|
||||
fail: /* the case-2/case-4 failures share this one `return 0`: a return
|
||||
* falling out of a conditional (as the first one does) is what
|
||||
* jump2's cross-jump would merge the early return into */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3289,11 +3289,6 @@ s32 func_80180FB4(void *a0)
|
||||
u16 st;
|
||||
|
||||
if (func_8012BD14(*(s32 *)((s32)a0 + 0x64)) > 0x4000) {
|
||||
/* LOAD-BEARING zero-byte cross-jump barrier (cookbook §5a).
|
||||
* Without it gcc's find_cross_jump merges this `move v0,0; j epi`
|
||||
* tail with the identical case-2 failure tail -> 58 ins instead of
|
||||
* 60, and the case-2 `beq` then loses its delay-slot fill. */
|
||||
__asm__ __volatile__(""); // !FAKE: barrier — NEEDED DIFFERS (P36 rung B tus9)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3304,13 +3299,13 @@ s32 func_80180FB4(void *a0)
|
||||
*(s16 *)((s32)p + 0x2) = 8;
|
||||
break;
|
||||
case 2:
|
||||
if (*(u16 *)((s32)p + 0x34) != 1) {
|
||||
return 0;
|
||||
if (*(u16 *)((s32)p + 0x34) == 1) {
|
||||
goto hit;
|
||||
}
|
||||
goto hit;
|
||||
goto fail;
|
||||
case 4:
|
||||
if (*(u16 *)((s32)p + 0x34) != 0) {
|
||||
return 0;
|
||||
goto fail;
|
||||
}
|
||||
hit:
|
||||
D_801ECE78 = st;
|
||||
@@ -3318,6 +3313,9 @@ s32 func_80180FB4(void *a0)
|
||||
*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0x2) = 10;
|
||||
break;
|
||||
default:
|
||||
fail: /* the case-2/case-4 failures share this one `return 0`: a return
|
||||
* falling out of a conditional (as the first one does) is what
|
||||
* jump2's cross-jump would merge the early return into */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user