build(phase-35): T3 — ov_SC04_019 TWIN_OF ov_SC04_018 with the primary's carve: yaml, JTBL_INTERLEAVE and the per-object JTBL_PADS lines regenerated from ov_SC04_018 by alias substitution (the twin's retired jump-table splits with them), create_c_files: False, src/ov_SC04_019/ deleted; twin + primary BYTE-IDENTICAL; interleave_check ALIGNED + pads_audit on the twin (R60; pads_audit now reads a twin's source through the oracle); dedup-check 0 failed; audit-binaries OK

This commit is contained in:
Drew T
2026-09-08 17:21:44 -06:00
parent e79cfcc06d
commit 2648aa5a92
73 changed files with 1977 additions and 160069 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,124 @@
splat 0.41.0 (powered by spimdisasm 1.41.0)
0%| | 0/1096 [00:00<?, ?it/s]
Loading symbols (symbols.us): 0%| | 0/1096 [00:00<?, ?it/s]
Loading symbols (symbols.us): 100%|██████████| 1096/1096 [00:00<00:00, 162402.22it/s]
0%| | 0/25 [00:00<?, ?it/s]
Loading symbols (symbols.resident): 0%| | 0/25 [00:00<?, ?it/s]
Loading symbols (symbols.resident): 100%|██████████| 25/25 [00:00<00:00, 322638.77it/s]
0%| | 0/5 [00:00<?, ?it/s]
Loading symbols (symbols.ov_SC04_019): 0%| | 0/5 [00:00<?, ?it/s]
Loading symbols (symbols.ov_SC04_019): 100%|██████████| 5/5 [00:00<00:00, 48321.47it/s]
0%| | 0/1 [00:00<?, ?it/s]
Scanning ov_SC04_019: 0%| | 0/1 [00:00<?, ?it/s]
Rodata segment 'ov_SC04_019' may belong to the text segment 'ov_SC04_019'
Based on the usage from the function func_801299C8 to the symbol jtbl_801E4440
The rodata segment 'ov_SC04_019' has jumptables that are not aligned properly file-wise, indicating one or more likely file split.
File split suggestions for this segment will follow in config yaml format:
- [0xBC2FC, .rodata]
Rodata segment 'ov_SC04_019_jr_8012ACE0' may belong to the text segment 'ov_SC04_019_jr_8012ACE0'
Based on the usage from the function func_8012ACE0 to the symbol jtbl_801E451C
The rodata segment 'ov_SC04_019_jr_8012ACE0' has jumptables that are not aligned properly file-wise, indicating one or more likely file split.
File split suggestions for this segment will follow in config yaml format:
- [0xBC490, .rodata]
- [0xBC4A4, .rodata]
Rodata segment 'ov_SC04_019_jr_80135888' may belong to the text segment 'ov_SC04_019_jr_80135888'
Based on the usage from the function func_80135888 to the symbol jtbl_801E4614
Rodata segment 'ov_SC04_019_jr_80135A4C' may belong to the text segment 'ov_SC04_019_jr_80135A4C'
Based on the usage from the function func_80135A4C to the symbol jtbl_801E462C
Rodata segment 'ov_SC04_019_jr_80135D20' may belong to the text segment 'ov_SC04_019_jr_80135D20'
Based on the usage from the function func_80135D20 to the symbol jtbl_801E4644
Rodata segment 'ov_SC04_019_jr_801380E0' may belong to the text segment 'ov_SC04_019_jr_801380E0'
Based on the usage from the function func_801380E0 to the symbol jtbl_801E4694
Rodata segment 'ov_SC04_019_o0c' may belong to the text segment 'ov_SC04_019_o0c'
Based on the usage from the function func_8013B83C to the symbol jtbl_801E46F8
Rodata segment 'ov_SC04_019_jr_8013F350' may belong to the text segment 'ov_SC04_019_jr_8013F350'
Based on the usage from the function func_8013F350 to the symbol jtbl_801E4D04
Rodata segment 'ov_SC04_019_jr_8013FFD8' may belong to the text segment 'ov_SC04_019_jr_8013FFD8'
Based on the usage from the function func_8013FFD8 to the symbol jtbl_801E4D3C
Rodata segment 'ov_SC04_019_jr_80140608' may belong to the text segment 'ov_SC04_019_jr_80140608'
Based on the usage from the function func_80140608 to the symbol jtbl_801E4DAC
Rodata segment 'ov_SC04_019_jr_8015444C' may belong to the text segment 'ov_SC04_019_jr_8015444C'
Based on the usage from the function func_8015444C to the symbol jtbl_801E4DD8
Rodata segment 'ov_SC04_019_jr_80154C24' may belong to the text segment 'ov_SC04_019_jr_80154C24'
Based on the usage from the function func_80154C24 to the symbol jtbl_801E4EB4
The rodata segment 'ov_SC04_019_jr_80154C24' has jumptables that are not aligned properly file-wise, indicating one or more likely file split.
File split suggestions for this segment will follow in config yaml format:
- [0xBCD80, .rodata]
Rodata segment 'ov_SC04_019_jr_801588CC' may belong to the text segment 'ov_SC04_019_jr_801588CC'
Based on the usage from the function func_801588CC to the symbol jtbl_801E4EF8
Rodata segment 'ov_SC04_019_jr_80159C84' may belong to the text segment 'ov_SC04_019_jr_80159C84'
Based on the usage from the function func_80159C84 to the symbol jtbl_801E4FA0
Rodata segment 'ov_SC04_019_jr_8015A3C8' may belong to the text segment 'ov_SC04_019_jr_8015A3C8'
Based on the usage from the function func_8015A3C8 to the symbol jtbl_801E4FD8
Rodata segment 'ov_SC04_019_jr_8015AE2C' may belong to the text segment 'ov_SC04_019_jr_8015AE2C'
Based on the usage from the function func_8015AE2C to the symbol jtbl_801E4FF8
Rodata segment 'ov_SC04_019_jr_8015C32C' may belong to the text segment 'ov_SC04_019_jr_8015C32C'
Based on the usage from the function func_8015C32C to the symbol jtbl_801E5038
Rodata segment 'ov_SC04_019_jr_8016AB6C' may belong to the text segment 'ov_SC04_019_jr_8016AB6C'
Based on the usage from the function func_8016AB6C to the symbol jtbl_801E506C
Rodata segment 'ov_SC04_019_jr_80171B4C' may belong to the text segment 'ov_SC04_019_jr_80171B4C'
Based on the usage from the function func_80171B4C to the symbol jtbl_801E50EC
Rodata segment 'ov_SC04_019_jr_801734BC' may belong to the text segment 'ov_SC04_019_jr_801734BC'
Based on the usage from the function func_801734BC to the symbol jtbl_801E510C
Rodata segment 'ov_SC04_019_jr_801789AC' may belong to the text segment 'ov_SC04_019_jr_801789AC'
Based on the usage from the function func_801789AC to the symbol jtbl_801E52B0
Rodata segment 'ov_SC04_019_jr_80178D40' may belong to the text segment 'ov_SC04_019_jr_80178D40'
Based on the usage from the function func_80178D40 to the symbol jtbl_801E52C8
Rodata segment 'ov_SC04_019_jr_8017A4AC' may belong to the text segment 'ov_SC04_019_jr_8017A4AC'
Based on the usage from the function func_8017A4AC to the symbol jtbl_801E54D0
Rodata segment 'ov_SC04_019_jr_8017AE2C' may belong to the text segment 'ov_SC04_019_jr_8017AE2C'
Based on the usage from the function func_8017AE2C to the symbol jtbl_801E5560
The rodata segment 'ov_SC04_019_jr_8017AE2C' has jumptables that are not aligned properly file-wise, indicating one or more likely file split.
File split suggestions for this segment will follow in config yaml format:
- [0xBD41C, .rodata]
- [0xBD450, .rodata]
Rodata segment 'ov_SC04_019_jr_80183E6C' may belong to the text segment 'ov_SC04_019_jr_80183E6C'
Based on the usage from the function func_80183E6C to the symbol jtbl_801E55D4
Rodata segment 'ov_SC04_019_jr_80185D70' may belong to the text segment 'ov_SC04_019_jr_80185D70'
Based on the usage from the function func_80185D70 to the symbol jtbl_801E5600
Rodata segment 'ov_SC04_019_jr_80186570' may belong to the text segment 'ov_SC04_019_jr_80186570'
Based on the usage from the function func_80186570 to the symbol jtbl_801E58BC
Rodata segment 'ov_SC04_019_jr_801878E8' may belong to the text segment 'ov_SC04_019_jr_801878E8'
Based on the usage from the function func_801878E8 to the symbol jtbl_801E5944
Rodata segment 'ov_SC04_019_jr_80188E1C' may belong to the text segment 'ov_SC04_019_jr_80188E1C'
Based on the usage from the function func_80188E1C to the symbol jtbl_801E599C
+13 -7
View File
@@ -478,7 +478,8 @@ ov_SC04_019_ELF := $(ov_SC04_019_OUT).elf
ov_SC04_019_MAPFILE := $(ov_SC04_019_OUT).map
ov_SC04_019_LD_SCRIPT := $(ov_SC04_019_OUT).ld
ov_SC04_019_SPLAT_YAML := config/splat.ov_SC04_019.yaml
ov_SC04_019_JTBL_INTERLEAVE := --order tail.data.o,ov_SC04_019.o,ov_SC04_019_jr_8012ACE0.o,tail2.data.o,ov_SC04_019_jr_80135888.o,tail3.data.o,ov_SC04_019_jr_80135A4C.o,tail4.data.o,ov_SC04_019_jr_80135D20.o,tail5.data.o,ov_SC04_019_jr_801380E0.o,ov_SC04_019_o0c.o,tail6.data.o,ov_SC04_019_jr_8013F350.o,tail7.data.o,ov_SC04_019_jr_8013FFD8.o,tail8.data.o,ov_SC04_019_jr_80140608.o,tail9.data.o,ov_SC04_019_jr_8015444C.o,ov_SC04_019_jr_80154C24.o,ov_SC04_019_jr_801588CC.o,ov_SC04_019_jr_80159C84.o,tail10.data.o,ov_SC04_019_jr_8015A3C8.o,tail11.data.o,ov_SC04_019_jr_8015AE2C.o,tail12.data.o,ov_SC04_019_jr_8015C32C.o,tail13.data.o,ov_SC04_019_jr_8016AB6C.o,tail14.data.o,ov_SC04_019_jr_80171B4C.o,ov_SC04_019_jr_801734BC.o,tail15.data.o,ov_SC04_019_jr_801789AC.o,ov_SC04_019_jr_80178D40.o,tail16.data.o,ov_SC04_019_jr_8017A4AC.o,tail17.data.o,ov_SC04_019_jr_8017AE2C.o,ov_SC04_019_jr_80181804.o,ov_SC04_019_jr_80183E6C.o,ov_SC04_019_jr_80185D70.o,tail18.data.o,ov_SC04_019_jr_80186570.o,tail19.data.o,ov_SC04_019_jr_801878E8.o,ov_SC04_019_jr_80188E1C.o,ov_SC04_019_jr_8018CC40.o,tail20.data.o,trailing.o # Phase-26 §8 jtbl-rodata carve
ov_SC04_019_JTBL_INTERLEAVE := --order tail.data.o,ov_SC04_019.o,ov_SC04_019_jr_8012ACE0.o,tail2.data.o,ov_SC04_019_jr_80135888.o,tail3.data.o,ov_SC04_019_jr_80135A4C.o,tail4.data.o,ov_SC04_019_jr_80135D20.o,tail5.data.o,ov_SC04_019_jr_801380E0.o,ov_SC04_019_o0c.o,tail6.data.o,ov_SC04_019_jr_8013F350.o,tail7.data.o,ov_SC04_019_jr_8013FFD8.o,tail8.data.o,ov_SC04_019_jr_80140608.o,tail9.data.o,ov_SC04_019_jr_8015444C.o,ov_SC04_019_jr_80154C24.o,ov_SC04_019_jr_801588CC.o,ov_SC04_019_jr_80159C84.o,tail10.data.o,ov_SC04_019_jr_8015A3C8.o,tail11.data.o,ov_SC04_019_jr_8015AE2C.o,tail12.data.o,ov_SC04_019_jr_8015C32C.o,tail13.data.o,ov_SC04_019_jr_8016AB6C.o,tail14.data.o,ov_SC04_019_jr_80171B4C.o,ov_SC04_019_jr_801734BC.o,tail15.data.o,ov_SC04_019_jr_801789AC.o,ov_SC04_019_jr_80178D40.o,tail16.data.o,ov_SC04_019_jr_8017A4AC.o,tail17.data.o,ov_SC04_019_jr_8017AE2C.o,ov_SC04_019_jr_80183E6C.o,ov_SC04_019_jr_80185D70.o,tail18.data.o,ov_SC04_019_jr_80186570.o,tail19.data.o,ov_SC04_019_jr_801878E8.o,ov_SC04_019_jr_80188E1C.o,ov_SC04_019_jr_8018CC40.o,tail20.data.o,trailing.o # Phase-26 §8 jtbl-rodata carve
# Phase 35 T3: ov_SC04_019's pads are ov_SC04_018's (the twin builds the primary's carve; regenerated by alias substitution)
build/src/ov_SC04_019/ov_SC04_019.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x14
build/src/ov_SC04_019/ov_SC04_019_jr_8012ACE0.o: JTBL_PADS := 0,0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0xcc,+0xe0
build/src/ov_SC04_019/ov_SC04_019_jr_80135D20.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x18
@@ -491,10 +492,10 @@ build/src/ov_SC04_019/ov_SC04_019_jr_80159C84.o: JTBL_PADS := 0,4 # §8e pads (
build/src/ov_SC04_019/ov_SC04_019_jr_8015AE2C.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20
build/src/ov_SC04_019/ov_SC04_019_jr_8016AB6C.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20
build/src/ov_SC04_019/ov_SC04_019_jr_80178D40.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x178
build/src/ov_SC04_019/ov_SC04_019_jr_8017AE2C.o: JTBL_PADS := 0,0,0 # §8e pads — None table(s), byte-proven by jtbl_pads_fix
build/src/ov_SC04_019/ov_SC04_019_jr_80181804.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x18
build/src/ov_SC04_019/ov_SC04_019_jr_8017AE2C.o: JTBL_PADS := 0,0,0,0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x14,+0x34,+0x48,+0x60
build/src/ov_SC04_019/ov_SC04_019_jr_80183E6C.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x18
build/src/ov_SC04_019/ov_SC04_019_jr_801878E8.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x38
build/src/ov_SC04_019/ov_SC04_019_jr_80188E1C.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20
build/src/ov_SC04_019/ov_SC04_019_o0c.o: JTBL_PADS := 0,4,4,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x38,+0xa8,+0x118
ov_SC04_019_CHECK_SHA := config/check.ov_SC04_019.sha
ov_SC04_019_SYMBOLS := config/symbols.ov_SC04_019.txt
@@ -504,7 +505,9 @@ ov_SC04_019_VRAM_BASE := 0x80128158
ov_SC04_019_TEXT_LO := 0x80128158
ov_SC04_019_TEXT_HI := 0x801E7B27
ov_SC04_019_ASM_DIR := asm/ov_SC04_019
ov_SC04_019_SRC_DIR := src/ov_SC04_019
# Phase 35 T3: ov_SC04_019 is a TWIN of ov_SC04_018 (identical payload): one source directory per payload; its carve = ov_SC04_018's.
ov_SC04_019_TWIN_OF := ov_SC04_018
ov_SC04_019_SRC_DIR := src/ov_SC04_018
ov_SC04_019_UNDEF_SYMS := build/ov_SC04_019/undefined_syms_auto.txt
ov_SC04_019_UNDEF_FUNCS := build/ov_SC04_019/undefined_funcs_auto.txt
@@ -1593,7 +1596,8 @@ ov_SC03_015_ELF := $(ov_SC03_015_OUT).elf
ov_SC03_015_MAPFILE := $(ov_SC03_015_OUT).map
ov_SC03_015_LD_SCRIPT := $(ov_SC03_015_OUT).ld
ov_SC03_015_SPLAT_YAML := config/splat.ov_SC03_015.yaml
ov_SC03_015_JTBL_INTERLEAVE := --order tail.data.o,ov_SC03_015.o,ov_SC03_015_jr_8012ACE0.o,tail2.data.o,ov_SC03_015_jr_80135888.o,tail3.data.o,ov_SC03_015_jr_80135A4C.o,tail4.data.o,ov_SC03_015_jr_80135D20.o,tail5.data.o,ov_SC03_015_jr_801380E0.o,ov_SC03_015_o0e.o,tail6.data.o,ov_SC03_015_jr_8013F350.o,tail7.data.o,ov_SC03_015_jr_8013FFD8.o,tail8.data.o,ov_SC03_015_jr_80140608.o,tail9.data.o,ov_SC03_015_jr_8015444C.o,ov_SC03_015_jr_80154C24.o,ov_SC03_015_jr_801588CC.o,ov_SC03_015_jr_80159C84.o,tail10.data.o,ov_SC03_015_jr_8015A3C8.o,tail11.data.o,ov_SC03_015_jr_8015AE2C.o,tail12.data.o,ov_SC03_015_jr_8015C32C.o,tail13.data.o,ov_SC03_015_jr_8016AB6C.o,tail14.data.o,ov_SC03_015_jr_80171B4C.o,ov_SC03_015_jr_801734BC.o,tail15.data.o,ov_SC03_015_jr_801789AC.o,ov_SC03_015_jr_80178D40.o,tail16.data.o,ov_SC03_015_jr_8017A4AC.o,tail17.data.o,ov_SC03_015_jr_8017AE2C.o,ov_SC03_015_jr_8017EB7C.o,tail18.data.o,ov_SC03_015_jr_80184F14.o,ov_SC03_015_jr_80185B44.o,tail19.data.o,trailing.o # Phase-26 §8 jtbl-rodata carve
ov_SC03_015_JTBL_INTERLEAVE := --order tail.data.o,ov_SC03_015.o,ov_SC03_015_jr_8012ACE0.o,tail2.data.o,ov_SC03_015_jr_80135888.o,tail3.data.o,ov_SC03_015_jr_80135A4C.o,tail4.data.o,ov_SC03_015_jr_80135D20.o,tail5.data.o,ov_SC03_015_jr_801380E0.o,ov_SC03_015_o0e.o,tail6.data.o,ov_SC03_015_jr_8013F350.o,tail7.data.o,ov_SC03_015_jr_8013FFD8.o,tail8.data.o,ov_SC03_015_jr_80140608.o,tail9.data.o,ov_SC03_015_jr_8015444C.o,ov_SC03_015_jr_80154C24.o,ov_SC03_015_jr_801588CC.o,ov_SC03_015_jr_80159C84.o,tail10.data.o,ov_SC03_015_jr_8015A3C8.o,tail11.data.o,ov_SC03_015_jr_8015AE2C.o,tail12.data.o,ov_SC03_015_jr_8015C32C.o,tail13.data.o,ov_SC03_015_jr_8016AB6C.o,tail14.data.o,ov_SC03_015_jr_80171B4C.o,ov_SC03_015_jr_801734BC.o,tail15.data.o,ov_SC03_015_jr_801789AC.o,ov_SC03_015_jr_80178D40.o,tail16.data.o,ov_SC03_015_jr_8017A4AC.o,tail17.data.o,ov_SC03_015_jr_8017AE2C.o,ov_SC03_015_jr_8017EB7C.o,tail18.data.o,ov_SC03_015_jr_801848E4.o,tail19.data.o,trailing.o # Phase-26 §8 jtbl-rodata carve
# Phase 35 T3: ov_SC03_015's pads are ov_SC03_014's (the twin builds the primary's carve; regenerated by alias substitution)
build/src/ov_SC03_015/ov_SC03_015.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x14
build/src/ov_SC03_015/ov_SC03_015_jr_8012ACE0.o: JTBL_PADS := 0,0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0xcc,+0xe0
build/src/ov_SC03_015/ov_SC03_015_jr_80135D20.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x18
@@ -1607,7 +1611,7 @@ build/src/ov_SC03_015/ov_SC03_015_jr_8015AE2C.o: JTBL_PADS := 0,4 # §8e pads (
build/src/ov_SC03_015/ov_SC03_015_jr_8016AB6C.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20
build/src/ov_SC03_015/ov_SC03_015_jr_80178D40.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x178
build/src/ov_SC03_015/ov_SC03_015_jr_8017AE2C.o: JTBL_PADS := 0,0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x14,+0x2c
build/src/ov_SC03_015/ov_SC03_015_jr_80185B44.o: JTBL_PADS := 0,0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20,+0x38
build/src/ov_SC03_015/ov_SC03_015_jr_801848E4.o: JTBL_PADS := 0,0,0,0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x18,+0x30,+0x50,+0x68
build/src/ov_SC03_015/ov_SC03_015_o0e.o: JTBL_PADS := 0,4,4,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x38,+0xa8,+0x118
ov_SC03_015_CHECK_SHA := config/check.ov_SC03_015.sha
ov_SC03_015_SYMBOLS := config/symbols.ov_SC03_015.txt
@@ -1617,7 +1621,9 @@ ov_SC03_015_VRAM_BASE := 0x80128158
ov_SC03_015_TEXT_LO := 0x80128158
ov_SC03_015_TEXT_HI := 0x801EB03F
ov_SC03_015_ASM_DIR := asm/ov_SC03_015
ov_SC03_015_SRC_DIR := src/ov_SC03_015
# Phase 35 T3: ov_SC03_015 is a TWIN of ov_SC03_014 (identical payload): one source directory per payload; its carve = ov_SC03_014's.
ov_SC03_015_TWIN_OF := ov_SC03_014
ov_SC03_015_SRC_DIR := src/ov_SC03_014
ov_SC03_015_UNDEF_SYMS := build/ov_SC03_015/undefined_syms_auto.txt
ov_SC03_015_UNDEF_FUNCS := build/ov_SC03_015/undefined_funcs_auto.txt
+4 -2
View File
@@ -37,7 +37,11 @@ options:
compiler: PSYQ
asm_path: asm/ov_SC04_019
# Phase 35 T3: a TWIN of ov_SC04_018 — the source lives ONCE in src/ov_SC04_018/ (config/overlays.mk `ov_SC04_019_TWIN_OF`); this yaml IS
# ov_SC04_018's carve with the alias substituted (the twin's own extra jump-table splits were retired with its source dir);
# src_path stays the twin's own name (the .ld's object paths), and splat must never recreate stub .c files.
src_path: src/ov_SC04_019
create_c_files: False
# asset_path scoped per-alias so a `bin` subseg (the trailing-partial-word carve, below) lands at
# assets/ov_SC04_019/*.bin and never collides with another overlay's same-named asset. The Makefile's
# build/assets/%.o rule incbin's it into a linkable object.
@@ -120,7 +124,6 @@ segments:
- [0x50be8, c, ov_SC04_019_jr_80178D40]
- [0x52354, c, ov_SC04_019_jr_8017A4AC]
- [0x52cd4, c, ov_SC04_019_jr_8017AE2C]
- [0x596ac, c, ov_SC04_019_jr_80181804]
- [0x5bd14, c, ov_SC04_019_jr_80183E6C]
- [0x5dc18, c, ov_SC04_019_jr_80185D70]
- [0x5e418, c, ov_SC04_019_jr_80186570]
@@ -168,7 +171,6 @@ segments:
- [0xbd378, .rodata, ov_SC04_019_jr_8017A4AC] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
- [0xbd404, data, tail17]
- [0xbd408, .rodata, ov_SC04_019_jr_8017AE2C] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
- [0xbd450, .rodata, ov_SC04_019_jr_80181804] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
- [0xbd47c, .rodata, ov_SC04_019_jr_80183E6C] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
- [0xbd4a8, .rodata, ov_SC04_019_jr_80185D70] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
- [0xbd4c4, data, tail18]
-581
View File
@@ -1,581 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
DEFINE_func_80128158() /* dedup: shared engine-core @0x80128158 (src/shared) */
DEFINE_func_80128178() /* dedup: shared engine-core @0x80128178 (src/shared) */
DEFINE_func_80128198() /* dedup: shared engine-core @0x80128198 (src/shared) */
DEFINE_func_801281B8() /* dedup: shared engine-core @0x801281B8 (src/shared) */
DEFINE_func_801281D8() /* dedup: shared engine-core @0x801281D8 (src/shared) */
DEFINE_func_801281F8() /* dedup: shared engine-core @0x801281F8 (src/shared) */
DEFINE_func_80128218() /* dedup: shared engine-core @0x80128218 (src/shared) */
DEFINE_func_80128228() /* dedup: shared engine-core @0x80128228 (src/shared) */
DEFINE_func_80128248() /* dedup: shared engine-core @0x80128248 (src/shared) */
DEFINE_func_80128268() /* dedup: shared engine-core @0x80128268 (src/shared) */
DEFINE_func_80128288() /* dedup: shared engine-core @0x80128288 (src/shared) */
DEFINE_func_801282CC() /* dedup: shared engine-core @0x801282CC (src/shared) */
DEFINE_func_801282EC() /* dedup: shared engine-core @0x801282EC (src/shared) */
DEFINE_func_8012832C() /* dedup: shared engine-core @0x8012832C (src/shared) */
DEFINE_func_80128420() /* dedup: shared engine-core @0x80128420 (src/shared) */
DEFINE_func_801284B8() /* dedup: shared engine-core @0x801284B8 (src/shared) */
DEFINE_func_801284F0() /* dedup: shared engine-core @0x801284F0 (src/shared) */
DEFINE_func_8012853C() /* dedup: shared engine-core @0x8012853C (src/shared) */
DEFINE_func_80128564() /* dedup: shared engine-core @0x80128564 (src/shared) */
DEFINE_func_801285D4() /* dedup: shared engine-core @0x801285D4 (src/shared) */
extern s32 func_800D18DC(void);
extern void func_8014607C(void);
extern void func_801287B8(void);
extern s32 func_80011A3C(void);
extern s32 D_801E9504;
void func_801285E4(void)
{
__asm__ __volatile__(
".set noreorder\n"
"addiu $sp, $sp, -24\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"sw $ra, 16($sp)\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_800D18DC\n"
"lui $at, %%hi(D_801E9504)\n"
"sw $v0, %%lo(D_801E9504)($at)\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"jal func_8014607C\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_801287B8\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"lui $v0, %%hi(D_801E9504)\n"
"lw $v0, %%lo(D_801E9504)($v0)\n"
"nop\n"
"beqz $v0, 1f\n"
"nop\n"
"jal func_80011A3C\n"
"1:\n"
"lw $ra, 16($sp)\n"
"addiu $sp, $sp, 24\n"
: : : "memory");
}
DEFINE_func_80128678() /* dedup: shared engine-core @0x80128678 (src/shared) */
// @class: other
// @stuck: none — MATCH (handwritten full inline-asm scratchpad-stack-switch wrapper w/ branch)
/*
* HANDWRITTEN scratchpad-stack-switch dispatcher (same idiom as func_80128564 /
* the func_8014ED28 family): repoints $sp into the D-cache scratchpad stack held
* at *(0x1F8003FC), calls func_800D19F0, stashes its $v0 result through D_801E9504,
* restores $sp, then dispatches on the stored value:
* if (D_801E9504 != 0) { func_8001903C(); func_80018FC8(); }
* else { func_8014607C(); <scratchpad-switch> func_801287B8(); }
* Manipulating $sp is not expressible in C; full inline asm (manages its own frame).
*
* NOTE (maspsx --aspsx-version=2.56): the inline ".set noreorder" is written with a
* SPACE, so maspsx's own is_reorder tracker stays True and it auto-fills EVERY
* jal/j/branch delay slot with a nop (GNU as honors noreorder and adds none). So do
* NOT write explicit delay-slot nops after jal/j/bne — that yields a double nop.
* bnez is written as `bne $v0,$zero` so maspsx recognizes it (bnez isn't in its
* branch set). The load-delay nop after `lw $v0,%lo(...)($v0)` is auto-inserted too.
* %hi/%lo escaped as %%hi/%%lo (bare % is an operand placeholder).
*/
void func_80128714(void) {
__asm__ __volatile__(
".set noreorder\n"
"addiu $sp, $sp, -24\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"sw $ra, 16($sp)\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_800D19F0\n"
"lui $at, %%hi(D_801E9504)\n"
"sw $v0, %%lo(D_801E9504)($at)\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"lui $v0, %%hi(D_801E9504)\n"
"lw $v0, %%lo(D_801E9504)($v0)\n"
"bne $v0, $zero, 1f\n"
"jal func_8014607C\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_801287B8\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"j 2f\n"
"1:\n"
"jal func_8001903C\n"
"jal func_80018FC8\n"
"2:\n"
"lw $ra, 16($sp)\n"
"addiu $sp, $sp, 24\n"
: : : "memory");
}
// @class: remat
// @stuck: none — MATCH (62 ins). D_801EAFD0 read needed the address REMATERIALIZED
// (lui;addiu;lw 0(reg), not the folded lui;lw %lo) AND pinned to $a0. volatile forces the
// remat; register __asm__("$4") forces the a0 allocation (gcc otherwise picks v0). Both levers
// required — pin-alone folds, volatile-alone lands in v0.
extern s32 D_80126B58;
extern s32 D_801EAFD0;
extern u16 D_800B99DA;
extern u8 D_800B9A64;
extern void func_80129CF8(void);
extern void func_8017849C(void);
extern void func_8014FDF4(struct S8014FDF4 *a0);
extern s32 func_801505FC(s32 a0);
extern void func_801508B4(void *a0);
extern void func_80165E90(void);
extern void func_801627E8(void);
extern void func_80162B1C(void);
extern void func_80165CA0(void);
extern void func_80129010(void);
extern void func_8013CA14(void);
extern void func_800190AC(void);
extern void func_8012956C(void);
extern void func_8016E95C(void);
extern void func_801754A8(void);
extern void func_8013BC7C(void);
extern void func_8013BCDC(void);
extern void func_801379FC(void);
extern void func_8001212C(void);
void func_801287B8(void) {
func_80129CF8();
func_8017849C();
((void (*)(void *))func_8014FDF4)(&D_80126B58);
((void (*)(void *))func_801505FC)(&D_80126B58);
func_801508B4(&D_80126B58);
func_80165E90();
func_801627E8();
func_80162B1C();
func_80165CA0();
func_80129010();
func_8013CA14();
func_800190AC();
func_8012956C();
func_8016E95C();
func_801754A8();
{
/* D_801EAFD0 read: the target materializes &sym into $a0 then lw 0($a0) (not the folded
* lui;lw %lo). volatile forces the rematerialize; the $4 pin forces the a0 allocation. */
register volatile s32 *p __asm__("$4") = &D_801EAFD0;
if (*p == 0) {
func_8013BC7C();
}
}
func_8013BCDC();
func_801379FC();
D_800B99DA++;
if (D_800B9A64 != 0) {
func_8001212C();
}
}
DEFINE_func_801288B0() /* dedup: shared engine-core @0x801288B0 (src/shared) */
// @class: remat
// @stuck: none — MATCH. &D_800C7C60 CSE'd once via pointer local `p` so the same reg feeds the *p=0x60 store AND arg5; writing D_800C7C60=0x60 directly would emit a 2nd address materialization (+1 ins). Mirrors matched sibling func_80128998.
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AF558;
extern int D_801E819C;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
int func_801288E8(int arg0)
{
int *p = &D_800C7C60;
*p = 0x60;
D_800C7C64 = &D_800A2E20;
((void (*)(int, int, int *, int, int *))func_8001ABBC)(0, 0, &D_800AF558, D_801E819C, p);
}
// @class: remat
// @stuck: none — MATCH (pointer-var forces single materialization of &D_800C7C60, reused as store base + arg5)
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern u8 D_800AF560;
extern s32 D_801E819C;
s32 func_80128940(s32 _arg0)
{
s32 *p = &D_800C7C60;
*p = 0x5E;
D_800C7C64 = &D_800A2E20;
((void (*)(s32, s32, void *, s32, void *))func_8001ABBC)(0, 0, &D_800AF560, D_801E819C, p);
}
// @class: remat
// @stuck: none — MATCH. &D_800C7C60 must be CSE'd once (pointer local `p`) so the same reg feeds the *p=13 store AND arg5; writing D_800C7C60=13 directly emits a 2nd address materialization (+1 ins).
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AECB0;
extern s32 D_801E819C;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
s32 func_80128998(void)
{
int *p = &D_800C7C60;
*p = 13;
D_800C7C64 = &D_800A2E20;
((void (*)(int, int, int *, int, int *))func_8001ABBC)(0, 0, &D_800AECB0, D_801E819C, p);
}
DEFINE_func_801289F0() /* dedup: shared engine-core @0x801289F0 (src/shared) */
extern void func_80011B7C(int);
extern void func_80011C10(void);
extern u16 D_800B99F6;
extern s16 D_800B9A00;
extern M2C_UNK (*D_8018B540)();
extern s16 (*D_8018B544)();
void func_80128A28(void) {
s16 temp_v0;
switch (D_800B99F6) { /* irregular */
case 1:
D_8018B540();
/* fallthrough */
case 0:
func_80011C10();
return;
case 2:
temp_v0 = D_8018B544();
if (temp_v0 != 0) {
if (temp_v0 < 0) {
func_80011B7C(0);
D_800B9A00 = 1;
return;
}
func_80010DE0();
} else {
return;
}
break;
}
}
extern u16 D_800B99F6;
extern M2C_UNK (*D_8018B54C)();
extern s32 (*D_8018B550)();
extern s32 D_801E9500;
void func_80128AF4(void) {
switch (D_800B99F6) { /* irregular */
case 0:
D_801E9500 = func_8002AF08();
func_80011C10();
return;
case 1:
D_8018B54C();
func_80011C10();
return;
case 2:
if ((D_8018B550() << 0x10) != 0) {
if (D_801E9500 == 1) {
if (func_800CFBE8() != 0) {
func_800CFBBC();
func_80011B7C(0x13);
} else {
func_80011B7C(4);
}
} else {
func_80010DE0();
}
func_8002AEF8();
}
return;
}
}
DEFINE_func_80128C14() /* dedup: shared engine-core @0x80128C14 (src/shared) */
extern CdFileLoc_80128C98 cdFileLocTable[];
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
s32 func_80128C98(s32 arg0) {
extern s16 D_8018B81C[];
s16 idx = D_8018B81C[arg0];
if (idx >= 0) {
func_8001ABBC(0, 0, (u8 *)&cdFileLocTable[idx], D_801E819C, 0);
} else {
return 1;
}
}
extern CdFileLoc cdFileLocTable[];
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
s32 func_80128CFC(s32 arg0) {
extern s16 D_8018B82C[];
s16 idx = D_8018B82C[arg0];
if (idx >= 0) {
func_8001ABBC(0, 0, (u8 *)&cdFileLocTable[idx], D_801E819C, 0);
} else {
return 1;
}
}
DEFINE_func_80128D60() /* dedup: shared engine-core @0x80128D60 (src/shared) */
DEFINE_func_80128DB4() /* dedup: shared engine-core @0x80128DB4 (src/shared) */
DEFINE_func_80128EA8() /* dedup: shared engine-core @0x80128EA8 (src/shared) */
DEFINE_func_80128ED8() /* dedup: shared engine-core @0x80128ED8 (src/shared) */
extern M2C_UNK D_801E81A0;
void func_80128FAC(u16 *arg0) {
func_8001534C(4, &D_801E81A0, 0x80, 0x90, 0, 0);
func_800153CC(5, *arg0, 0xA8, 0x90, 0x40, 0);
}
DEFINE_func_80129010() /* dedup: shared engine-core @0x80129010 (src/shared) */
DEFINE_func_801290DC() /* dedup: shared engine-core @0x801290DC (src/shared) */
DEFINE_func_8012913C() /* dedup: shared engine-core @0x8012913C (src/shared) */
DEFINE_func_801291C0() /* dedup: shared engine-core @0x801291C0 (src/shared) */
DEFINE_func_80129220() /* dedup: shared engine-core @0x80129220 (src/shared) */
DEFINE_func_80129248() /* dedup: shared engine-core @0x80129248 (src/shared) */
DEFINE_func_80129258() /* dedup: shared engine-core @0x80129258 (src/shared) */
DEFINE_func_8012927C() /* dedup: shared engine-core @0x8012927C (src/shared) */
DEFINE_func_801292C8() /* dedup: shared engine-core @0x801292C8 (src/shared) */
DEFINE_func_8012931C() /* dedup: shared engine-core @0x8012931C (src/shared) */
DEFINE_func_80129350() /* dedup: shared engine-core @0x80129350 (src/shared) */
DEFINE_func_80129374() /* dedup: shared engine-core @0x80129374 (src/shared) */
DEFINE_func_80129398() /* dedup: shared engine-core @0x80129398 (src/shared) */
DEFINE_func_80129428() /* dedup: shared engine-core @0x80129428 (src/shared) */
DEFINE_func_8012943C() /* dedup: shared engine-core @0x8012943C (src/shared) */
DEFINE_func_8012944C() /* dedup: shared engine-core @0x8012944C (src/shared) */
DEFINE_func_8012956C() /* dedup: shared engine-core @0x8012956C (src/shared) */
DEFINE_func_801298F4() /* dedup: shared engine-core @0x801298F4 (src/shared) */
// @class: schedule
// @stuck: none — MATCH (158 ins, match_one relocation-masked)
//
// Levers that landed it (2 iterations, 56 mismatched -> MATCH):
// 1. §43 K&R s16-param definition: `void f(a0,a1,a2) s16 a0; s16 a1; u8 *a2;` reproduces the
// in-place `sll $a0,$a0,16` zero-test on the arg reg + the raw-$a1 copy (`addu $a3,$a1,$zero`)
// stashed in the jtbl branch delay slot and RE-extended per use in the case body.
// 2. §18 array-of-struct %lo-fold: three sibling extern arrays D_801E9508/1/2[] (a 4-row x 3-comp
// RGB gradient table, stride 4) give `lui $at,%hi(sym); addu $at,$at,idx4; sb $v0,%lo(sym)($at)`
// for the indexed case and plain `lui/sb %lo(sym+k)` for the constant-index case.
// 3. Switch CASE-ORDER = source order: the jump table dispatches case 1 to the FIRST emitted block,
// so `case 1:` must be written before `case 0/2:` and `case 3/4:`.
// 4. THE residual (56 -> 0): the case-1 body must be written ROW-MAJOR (BE0[0],BE1[0],BE2[0],
// BE0[4],BE1[4],BE2[4],...), i.e. the natural table fill. gcc-2.7.2's sched pass then REORDERS
// the stores itself (BE0,BE1,BE5,BE8,BE4,BEC,BE9,BED,BE2,BE6,BEA,BEE) because the three arrays
// are distinct declarations => provably non-aliasing. Writing the source in the target's STORE
// order is the trap: it pins the b*255 / r*143 CSEs at their late store sites instead of letting
// them hoist into $a0/$v1 at rows 0/1, and mis-schedules the D_801EAED0 load.
// 5. Shift signedness: `u32` component locals give `srl` for r*5>>3 and g*25>>1; an explicit
// `(s32)(x * 255) >> 4` gives `sra` for the *255 / *143 / *45 terms (mixed within one block).
DEFINE_func_801299C8() /* dedup: shared engine-core @0x801299C8 (src/shared) */
DEFINE_func_80129C40() /* dedup: shared engine-core @0x80129C40 (src/shared) */
DEFINE_func_80129CF8() /* dedup: shared engine-core @0x80129CF8 (src/shared) */
DEFINE_func_80129FF4() /* dedup: shared engine-core @0x80129FF4 (src/shared) */
DEFINE_func_8012A018() /* dedup: shared engine-core @0x8012A018 (src/shared) */
DEFINE_func_8012A048() /* dedup: shared engine-core @0x8012A048 (src/shared) */
DEFINE_func_8012A094() /* dedup: shared engine-core @0x8012A094 (src/shared) */
DEFINE_func_8012A0E0() /* dedup: shared engine-core @0x8012A0E0 (src/shared) */
DEFINE_func_8012A100() /* dedup: shared engine-core @0x8012A100 (src/shared) */
DEFINE_func_8012A110() /* dedup: shared engine-core @0x8012A110 (src/shared) */
// @class: regalloc-order
// @stuck: none — MATCH (78 ins, relocation-masked). Register pins ($2-$5 reused for
// the D_x200-x20C words then the D_x220-x226 halfwords; $6-$10 held across for the
// D_x228/x22A/x294/x298/x29A tail) force the frameless 9-deep allocation the default
// -O2 pre-reload scheduler otherwise blows to a 3-reg spill (all 720 stmt orders spill
// without the pins). A single zero-byte scheduling/memory barrier after the 4 word
// stores stops gcc hoisting the first 8-byte block copy above them.
DEFINE_func_8012A1BC() /* dedup: shared engine-core @0x8012A1BC (src/shared) */
DEFINE_func_8012A2F4() /* dedup: shared engine-core @0x8012A2F4 (src/shared) */
DEFINE_func_8012A304() /* dedup: shared engine-core @0x8012A304 (src/shared) */
DEFINE_func_8012A328() /* dedup: shared engine-core @0x8012A328 (src/shared) */
DEFINE_func_8012A418() /* dedup: shared engine-core @0x8012A418 (src/shared) */
DEFINE_func_8012A464() /* dedup: shared engine-core @0x8012A464 (src/shared) */
DEFINE_func_8012A4BC() /* dedup: shared engine-core @0x8012A4BC (src/shared) */
extern void func_8012A598(void *a0);
void func_8012A568(void (*a0)(void)) {
func_8012A598(a0);
a0();
}
DEFINE_func_8012A598() /* dedup: shared engine-core @0x8012A598 (src/shared) */
DEFINE_func_8012A5F8() /* dedup: shared engine-core @0x8012A5F8 (src/shared) */
DEFINE_func_8012A62C() /* dedup: shared engine-core @0x8012A62C (src/shared) */
DEFINE_func_8012A68C() /* dedup: shared engine-core @0x8012A68C (src/shared) */
DEFINE_func_8012A6D0() /* dedup: shared engine-core @0x8012A6D0 (src/shared) */
DEFINE_func_8012A758() /* dedup: shared engine-core @0x8012A758 (src/shared) */
DEFINE_func_8012A79C() /* dedup: shared engine-core @0x8012A79C (src/shared) */
DEFINE_func_8012A7D4() /* dedup: shared engine-core @0x8012A7D4 (src/shared) */
DEFINE_func_8012A828() /* dedup: shared engine-core @0x8012A828 (src/shared) */
DEFINE_func_8012A860() /* dedup: shared engine-core @0x8012A860 (src/shared) */
DEFINE_func_8012A8B0() /* dedup: shared engine-core @0x8012A8B0 (src/shared) */
DEFINE_func_8012A8E8() /* dedup: shared engine-core @0x8012A8E8 (src/shared) */
DEFINE_func_8012A908() /* dedup: shared engine-core @0x8012A908 (src/shared) */
DEFINE_func_8012A988() /* dedup: shared engine-core @0x8012A988 (src/shared) */
DEFINE_func_8012AAAC() /* dedup: shared engine-core @0x8012AAAC (src/shared) */
DEFINE_func_8012ACA0() /* dedup: shared engine-core @0x8012ACA0 (src/shared) */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-13
View File
@@ -1,13 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
DEFINE_func_80135888() /* dedup: shared engine-core @0x80135888 (src/shared) */
-730
View File
@@ -1,730 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
extern void func_80128288(void);
extern void func_80128158(void);
extern void func_801285E4(void);
extern void func_80128178(void);
extern void func_80128678(void);
extern void func_80128198(void);
extern void func_80128714(void);
extern void func_801281B8(void);
extern void func_8013E67C(void);
extern void func_801281D8(void);
extern void func_8013E558(void);
extern void func_801281F8(void);
extern s32 D_801E819C;
extern s32 func_80128218(void);
extern void func_80128A28(void);
extern void func_80128228(void);
extern void func_80128AF4(void);
extern void func_80128248(void);
extern void func_801282EC(void);
extern void func_80128268(void);
extern u16 D_800B99F6;
extern void (*D_8018B804[])(void);
extern void func_80011B7C(int);
extern void func_801282CC(void);
extern void func_8001C0C8(void);
extern void func_80015310(void);
extern void func_80129258(void);
extern void func_801378F0(void);
extern void func_80010E14(void);
extern s16 currentLocationId;
extern s32 func_80029504(void);
extern s32 func_800CF854(s32);
extern s32 func_80128998(void);
extern s32 func_801289F0(void);
extern s32 func_801288E8(s32);
extern s32 func_80128940(s32);
extern s32 func_80029178(s32);
extern s32 func_801288B0(void);
extern void func_80011C10(void);
extern void func_8012832C(void);
extern void func_80129220(void);
extern void func_80011E24(void);
extern void func_80128C14(void);
extern void func_8002AEF8(void);
extern void func_800CFBBC(void);
extern void SsUtReverbOff(void);
extern void func_8013C98C(void);
extern void func_80129C40(s32 a0);
extern void func_800D0630(void);
extern void func_80145CEC(void);
extern void func_80144B9C(void);
extern u8 D_800B9A17;
extern u8 D_800B9A10;
extern void func_80128420(void);
extern s32 func_800D0588(void);
extern void func_801284B8(void);
extern void func_80175308(void);
extern void func_8016E8F0(void);
extern void func_80175494(void);
extern u8 D_800B9A64;
extern void func_801284F0(void);
extern void func_80146074(void);
extern void func_8012853C(void);
extern void func_80178608(void);
extern void func_8002D4C8(s32 a0, s32 a1);
extern s32 func_80011A3C(void);
extern short currentLocationId;
extern short D_800B99F2;
extern void func_80128564(void);
extern u8 D_800B9A11;
extern void func_801285D4(void);
extern s32 func_800D18DC(void);
extern void func_8014607C(void);
extern void func_801287B8(void);
extern s32 D_801E9504;
extern void func_80029444(void);
extern void func_800D1754(void);
extern s32 D_80126B58;
extern s32 D_801EAFD0;
extern u16 D_800B99DA;
extern void func_80129CF8(void);
extern void func_8017849C(void);
extern void func_8014FDF4(struct S8014FDF4 *a0);
extern s32 func_801505FC(s32 a0);
extern void func_801508B4(void *a0);
extern void func_80165E90(void);
extern void func_801627E8(void);
extern void func_80162B1C(void);
extern void func_80165CA0(void);
extern void func_80129010(void);
extern void func_8013CA14(void);
extern void func_800190AC(void);
extern void func_8012956C(void);
extern void func_8016E95C(void);
extern void func_801754A8(void);
extern void func_8013BC7C(void);
extern void func_8013BCDC(void);
extern void func_801379FC(void);
extern void func_8001212C(void);
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
extern u8 D_800AEFD0;
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AF558;
extern int D_801E819C;
extern int func_801288E8(int arg0);
extern u8 D_800AF560;
extern s32 func_80128940(s32 _arg0);
extern int D_800AECB0;
extern u8 D_800AECB8;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
extern s16 D_800B9A00;
extern M2C_UNK (*D_8018B540)();
extern s16 (*D_8018B544)();
extern M2C_UNK (*D_8018B54C)();
extern s32 (*D_8018B550)();
extern s32 D_801E9500;
extern void func_80010AE0(s32 a0);
extern void func_80018450(s32 a0, s32 a1);
extern void func_800183E0(s32 a0);
extern void func_80128D60(s32 a0, s32 *a1, s32 *a2);
extern s32 func_80128DB4(s32 a0, s32 *a1);
extern void func_80128EA8(s32 a0, s32 a1, s32 a2);
extern M2C_UNK D_801E81A0;
extern void func_80128FAC(u16 *arg0);
extern s16 D_8011DB2C;
extern s16 D_8011DB30;
extern s32 D_80126AEC;
extern u8 *func_8012913C(s32 a0);
extern u8 * func_801290DC(s32 a0, u8 *a1);
extern void func_8001D074(s32 a, s32 b);
extern u8 *func_801291C0(void);
extern s32 func_8001CC3C(s32 a0, s32 a1, s32 a2, s32 a3);
extern u8 * func_8012913C(s32 arg0);
extern void func_80016714(void *a0, s32 a1);
extern u8 * func_801291C0(void);
extern void func_80129248(s16 a0);
extern void func_801292C8(u8 *a0);
extern void func_8012927C(void);
extern void func_8012931C(struct vec *a0);
extern void func_80129350(s32 a0, s32 a1);
extern void func_80129374(s32 a0, s32 a1);
extern s16 D_800B9AAC[];
extern s16 D_800B9AAE[];
extern s16 D_800B9AB0[];
extern s16 D_800B9AB2[];
extern s16 D_800B9AB4[];
extern s16 D_800B9AB6[];
extern s16 D_800B9AB8[];
extern s16 D_800B9ABA[];
extern void func_80129398(void);
extern s16 D_80114EE0;
extern void func_80129428(void);
extern void func_8012943C(void);
extern s32 D_8005128C;
extern u8 D_800B9A78;
extern void func_801298F4(void *arg0);
extern void func_801299C8(s32 a, s32 b, s32 c);
extern void func_8012944C(void);
extern unsigned short D_800B99F0;
extern void func_8012A328(void);
extern void func_80053308(s32);
extern s32 func_80012F74(s32, s32, s32, s32); /* canonical s32 (engine_core); (s16)-cast the return for the sll/sra */
extern void GsSetRefView2L(void *);
extern s8 D_801150D6; /* canonical (engine_core macro): s8 — access via *(u8*)& for lbu */
extern u8 D_80127504;
extern s32 D_80126E60[];
extern s32 D_80126F04[];
extern u8 D_80126948[]; /* canonical (sibling): u8[] — cast (s32*) at use */
extern s32 D_80126FA8[];
extern struct BigCopy D_80126DB8;/* canonical (engine_core macro): struct BigCopy — (s32*)& at use */
extern u8 D_800AF630[]; /* canonical (sibling): u8[] — cast (s32*) at use */
extern s32 D_800AE688[];
extern s32 D_801151D4; /* canonical (10 siblings): scalar s32 — store (s32)ptr */
extern void func_8012A018(s32 a, s32 b);
extern void func_80129FF4(void);
extern u16 D_80126B5E;
extern u16 D_80126B62;
extern u16 D_80126B66;
extern s16 D_80126940;
extern s16 D_80126942;
extern s16 D_80126944;
extern void func_8012A048(void *a0, s32 a1, u8 a2);
extern void *memcpy(void *, const void *, unsigned int);
extern void func_8012A094(s32 a0);
extern void func_8012A100(s8 a0);
extern void func_8012A0E0(void);
extern s8 D_801150D6;
extern s32 D_80120204;
extern s32 D_80120200;
extern s32 D_8012020C;
extern s32 D_80120208;
extern s16 D_80120218;
extern s16 D_80120210;
extern s16 D_8012021A;
extern s16 D_80120212;
extern s16 D_8012021C;
extern s16 D_80120214;
extern s16 D_80120226;
extern s16 D_80120220;
extern s16 D_80120228;
extern s16 D_80120222;
extern s16 D_8012022A;
extern s16 D_80120224;
extern s32 D_80120294;
extern s16 D_80120298;
extern s16 D_8012029A;
extern void func_8012A110(void);
extern s8 D_801152C0;
extern void func_8012A2F4(void);
extern s16 D_80127080;
extern s16 D_801152C2;
extern void func_8012A304(s32 a0, s32 a1);
extern s32 D_801151D4;
extern struct BigCopy D_80126DB8;
extern struct BigCopy D_80114EE8;
extern void func_8012A4BC(void);
extern void func_8012A62C(s32);
extern void func_8012A5F8(void (*a0)(void), s32 a1);
extern void func_8012A62C(s32 a0);
extern void func_8012A7D4(void *a0, void *a1);
extern s32 func_8012A6D0(void *a0, void *a1);
extern s16 func_8012A68C(void);
extern s16 func_8012A79C(s16 *a0, s16 *a1);
extern s16 func_8012A758(void);
extern s32 ratan2(s32 a0, s32 a1);
extern void func_8012A7D4(void *arg0, void *arg1);
extern void func_8012AAAC();
extern void func_8012A828(s32 a0, void * a1);
extern int func_8012ACE0(void *a0);
extern void func_8012A860(void *a0, int a1);
extern void func_8012A8B0(u8 *a0, s32 a1);
extern void func_8012A8E8(void);
extern u8 D_801202A0[];
extern u16 D_801270C0;
extern void func_8012A988(u8 *a0);
extern void func_8012A908(void);
extern s32 func_8012ACE0(void *a0);
extern M2C_UNK D_8018B898;
extern void func_8012ACA0(void *arg0);
extern s32 func_8012ACE0(void *o);
extern void func_8012AD44(s32 *a0, s16 a1);
extern s32 func_8012AD50(void * arg0);
extern void func_8012AD64(s32 *a0, s16 a1);
extern void func_8012AD6C(void *a0);
extern void func_8012AD80(s32 a0);
extern void func_8012ADE4(u8 *a0);
extern s32 *D_80126B78;
extern s32 *D_80126B90;
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
extern s32 func_80013478(s32 a0, s32 a1);
extern s32 func_8012AE00(s32 a0);
extern s32 func_8012AF0C(s32 a0, s32 a1);
extern s32 func_80134510(s32 arg);
extern s32 func_8012B030(u8 *a0);
extern int func_80047948(int a0);
extern int func_8004787C(int a0);
extern void func_8012B0B4(unsigned int *param_1, int param_2, int param_3);
extern void func_800484EC(s32 a0, s32 a1, s32 a2);
extern void func_8012B14C(s32 a0, s32 a1);
extern void func_8012B178(s32 a0, s32 a1);
extern void func_8012B1B4(s32 a0, s32 a1);
extern void func_8012B200(u8 *a0);
extern void func_8012B21C(void *a0);
extern void func_8012B23C(s32 a0);
extern void func_8012B260(u8 *a0);
extern void func_80049CAC(s32 a0, s32 a1);
extern void func_8012B2CC(s32 a0);
extern void RotMatrixYXZ(void *m, void *p);
extern void func_8012B370(int a0);
extern void func_8004978C(s16 *a0, void *a1);
extern void func_8012B414(int a0);
extern s32 func_8012B608(s32 a0, s32 a1, s32 a2);
extern s32 func_8012B6D4(s16 *a0, s16 *a1);
extern s32 func_8012B70C(s16 *a0, s16 *a1);
extern s32 ratan2(s32 x, s32 y);
extern s32 func_8012B744(void *a0, void *a1);
extern s16 D_80126CB8;
extern s16 D_80126CB4;
extern s32 func_8012B864(s32 a0);
extern s32 func_8012B8A4(s16 *a0);
extern s32 func_8012B8E4(s32 arg0, s32 arg1);
extern s32 func_8012BA10(s32 arg0, s32 arg1);
extern s32 func_8012BB3C(s32 arg0, s32 arg1, u32 arg2, s32 arg3);
extern void Square0(s32 *a0, s32 *a1);
extern s32 func_8012BC60(struct Vec *a0, struct Vec *a1);
extern s16 D_80126CBA;
extern s32 func_8012BCCC(s32 a0);
extern void func_80013350(s32 a0, void *a1);
extern u8 D_80126B5C;
extern void func_8012BD14(s32 a0);
extern s32 func_8012BDBC(s32 a0, s32 a1);
extern s32 func_8012BD3C(s32 a0, s32 a1, s32 a2);
extern void func_8012BE98(s32 a0, u16 *a1);
extern void func_8012BE54(s32 a0);
extern s32 func_800132BC(s32 a0, s32 a1);
extern void func_8012BE98(s32 arg0, u16 * arg1);
extern s32 func_8012BEE8(s32 a0);
extern s32 func_8012BF10(s32 a0, s32 a1);
extern void func_8012BF4C(s32 *a0, s32 a1);
extern void func_8012BF54(void *a0);
extern void func_8012BF68(void *a0);
extern s16 D_80126CB0;
extern s32 func_8012BF7C(s16 *a0);
extern s16 D_80126CAC;
extern short D_80126CAE;
extern int func_8012BFA8(short *a0);
extern s32 D_801274D4;
extern s32 D_801274E0;
extern s32 func_8012C044(s32 a0);
extern void func_8012C218(void *a0);
extern void func_8012C098(void *param_1);
extern s32 func_8012C0EC(s32 a0);
extern void func_8012C194(void);
extern void func_8001CFDC(s32 a, s32 b);
extern void func_8012C1B8(void);
extern u8 D_800B3DF0[];
extern s32 func_8012C1DC(s32 a0);
extern u8 D_80126720[];
extern u16 * func_8012C284(u16 *a0);
extern u8 D_80120194[];
extern s32 func_8012C2D0(void);
extern s32 func_8012C31C(void);
extern void func_8012CAE4(void *a0);
extern void func_8001C214(s32 a0, s32 a1);
extern u8 D_80078EAE;
extern s32 func_8012C354(s32 a0, s32 a1);
extern void func_8001C810(s32 a0, s32 a1);
extern s32 func_8012C438(s32 a0, s32 a1);
extern s32 func_8012C890(s32 a0, s32 a1, s32 a2);
extern s32 func_8012C51C(void *a0, s32 a1);
extern s32 func_8012C588(s32 a0, s32 a1);
extern void func_8012C724(s32 a0, s32 a1);
extern s32 func_8012C750(s32 a0);
extern s32 func_8012C820(u8 *a0);
extern s32 D_8018ED7C;
extern s16 D_801270C4;
extern u16 D_801274E4[];
extern s32 D_8011DB08;
extern s32 func_8012CB64(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
extern s32 func_8012CC88(s32 a, s32 b, s32 c);
extern u8 D_800D3918[];
extern void func_8012CBA4(s32 a0);
extern void func_8012CBCC(s32 a0);
extern void func_8012CBF4(s32 a0);
extern void func_8012CC1C(s32 arg0, s32 arg1);
extern void func_8012CC40(s32 arg0, s32 arg1);
extern s32 func_8012CC88(s32 a0, s32 a1, s32 a2);
extern void func_8012CC64(s32 a0, s32 a1);
extern s32 func_80133784(s32 a0, void *a1, s32 a2);
extern s32 func_8012CE2C(s32 a0);
extern s32 func_8012CEB0(s32 a0, s32 a1, s32 a2);
extern void func_8012CFA8(s32 arg0);
extern void func_8012F214(s32 a0, s32 a1, s32 a2);
extern void func_8012D3B4(s32 arg0, s32 arg1, s32 arg2);
extern void func_8012D098(u16 *param_1, u32 param_2);
extern void func_8012D098();
extern void func_8012D38C(int a0);
extern void func_8012D3AC(void);
extern s32 AddPrim(s32, void *);
extern s32 RotTransPers(s32, s32, s32 *, s32 *);
extern void SetLineF2(void *);
extern void *func_80010A08(s32);
extern void func_8004914C(void *);
extern void func_800491AC(void *);
extern s32 D_800A651C;
extern u8 D_800AF648;
extern s16 D_800B9A02;
extern void func_8012D4B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern void func_8012D5DC(void);
extern s16 D_80126B98;
extern s32 func_8012DEB8(s32 a0, s32 a1, s32 a2);
extern s32 func_8012D5E4(s32 a0, s32 a1, s32 a2, s32 a3);
extern int func_8012D664();
extern void func_8012D624(s32 a0);
extern int func_8012D664(int arg0, int arg1, int arg2);
extern s32 func_8012D714(s32 param_1, u32 param_2);
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
extern void func_8014C978(void);
extern M2C_UNK D_8018B8B0;
extern M2C_UNK D_8018B8B8;
extern s32 func_8012DB84(void);
extern s32 func_8012DE2C(s32 a0);
extern s32 func_8012DDA4(void);
extern s32 func_8012DBD0(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_8012DDA4();
extern s32 func_8012DF34(s32 a0, s32 a1, s32 a2);
extern s16 D_80126B9A;
extern u8 D_801152A8[];
extern void func_8012DFBC(void);
extern void func_8012DFCC(void);
extern void func_8012E014(s32 arg0);
extern void func_8012E138(void);
extern void func_8012DFD4(u8 *a0);
extern s32 func_8012E27C(void);
extern void func_8012E284(void);
extern s32 GetTPage(s32, s32, s32, s32);
extern s32 func_8005A600(s32, s32, s32, s32, s32);
extern void func_8012E28C(s32 arg0, s32 arg1);
extern void func_8004914C(void *a0);
extern void func_800491AC(void *a0);
extern void func_8012E32C(void);
extern s32 func_8012E470(s32 a0);
extern void func_8012E4C8(s32 a0);
extern s32 func_8012E504(s32 a0, s32 a1);
extern s32 func_8012E544(s32 a0);
extern s32 func_8012E57C(s32 a0, s32 a1);
extern s32 RotTransPers(s32 a0, s32 a1, s32 *a2, s32 *a3);
extern void func_8012E5CC(s32 param_1, u16 param_2, u16 param_3);
extern void func_8012E688(s32 param_1, u16 param_2, u16 param_3);
extern s32 func_8012E778(int param_1, int param_2);
extern void func_8012E88C(u8 *a0);
extern void func_8012E8A8(u8 *a0);
extern void func_8012E8C4(u8 *a0);
extern void func_8012E8E0(s32 a0, s32 a1);
extern void func_8016AA50(int, int);
extern void func_8016B428(int);
extern void func_80019064(void *);
extern int D_8018B8C0;
extern void func_8012E9C0(int param_1);
extern void func_8012EA90(s32 param_1, s32 param_2, s32 *param_3);
extern void func_8012EC04(s32 param_1, s32 param_2, s32 *param_3);
extern s32 func_8002A4FC(s32 a0);
extern s32 func_8012EECC(s32 a0);
extern void func_8012EFB8(s32 a0);
extern void func_8012EF34(s32 a0, s32 a1);
extern void func_8012EF70(s32 a0, s32 a1);
extern void ApplyTransposeMatrixLV(void *a0, void *a1, void *a2);
extern void func_8012F038(int param_1, short *param_2, short *param_3);
extern void func_8012F0BC(s32 *a0, s32 *a1, s32 *a2);
extern void RotTransSV(s32 a0, s32 a1, void *a2);
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
extern void func_8012F1A4(s32 *a0, s32 a1, s32 *a2);
extern void func_8012F2E8(s32 a0, s32 a1, s32 a2);
extern s16 D_80126CB6;
extern void func_8012F374(s32 a0, s32 a1);
extern void *memcpy(void *, const void *, u32);
extern u8 D_80126C38;
extern u8 D_80126C40;
extern u16 D_80126B94;
extern u16 D_80126B96;
extern void func_8012F568(s32 param_1, s32 param_2, s32 param_3, s32 param_4, s32 param_5, s32 param_6);
extern void func_80131B14();
extern void func_80131E00(struct S80131E00 *a0, s32 a1);
extern s32 func_80131A34(s32, s32);
extern void func_80131CA8(int a0, int a1);
extern void func_8012F5F4(s32 arg0);
extern void func_80131C78(s32 a0);
extern void func_8012F68C(s32 arg0);
extern void func_8012F75C(s32 a0);
extern s32 func_8012BEE8(s32);
extern void func_8012F7B4(s32 a0);
extern void func_80131170();
extern void func_80131CA8();
extern unsigned char D_8018B8DC[];
extern void func_8012F828(int param_1);
extern void func_80131340(s32 a0);
extern void func_8012F87C(s32 a0);
extern void func_80131170(s32 a0, s32 a1, s32 a2);
extern u8 D_8018B8E8[];
extern void func_8012F8C8(u8* arg0);
extern void func_8012F91C(s32 a0);
extern s32 func_80131A34(s32 a0, s32 a1);
extern void func_80131CA8(s32 a0, s32 a1);
extern void func_8012F968(s32 param_1);
extern void func_801319E0(s32 a0);
extern s32 func_80143B6C(s32 a0, s32 a1);
extern void func_8012FB54(s32 a0);
extern void func_8012FC30(s32 a0);
extern void func_8012FCA4(int a0);
extern s32 func_8012FCC4(s32 param_1);
extern void func_8012FDA8(int param_1);
extern void func_8012FE70(s32 a0);
extern void func_8012FF00(s32 a0);
extern void func_8012FF4C(s32 a0);
extern void func_80130D48(s32 a0);
extern void func_8012FF98(u8 *a0);
extern s32 func_80131AC8(void *a0);
extern void func_8013001C(void *a0);
extern void func_80130088(void *a0);
extern s32 func_8012BCCC(s32);
extern void func_801300F4(s32 a0);
extern void func_801301E8(u8 *a0);
extern void func_80130278(s32 arg0);
extern void func_80130314(s32 a0);
extern void func_80130360(s32 a0);
extern void func_8012E364(void);
extern void func_801303A0(s32 a0);
extern void func_801303EC(void *a0);
extern void func_80143CD4(s32 a0);
extern void func_800CB0E8(s32 a0);
extern void func_80130438(s32 a0);
extern void func_801319E0(int);
extern int func_80131D68(int, int);
extern int func_8012BEE8(int);
extern void func_80131CA8(int, int);
extern void func_80130514(int param_1);
extern void func_801305CC(u8 *a0);
extern void func_8012CBF4(s32);
extern s32 func_80131D68(s32 a0, s32 a1);
extern void func_80130650(s32 a0);
extern s32 func_80146A6C(s32 a0, void *a1, s32 a2, s32 a3, s32 a4, s32 a5, s32 a6);
extern void func_80130740(void *a0, u16 *a1);
extern s32 func_801312D0(s32 a0, void *a1);
extern void func_801307B0(s32 a0);
extern void func_80130858(s32 a0);
extern void func_80130898(u8 *a0);
extern void func_801308DC(s32 a0);
extern void func_80166244();
extern void func_80130974(int param_1);
extern void func_80130A18(u8 *a0);
extern void func_80130AC4(s32 a0);
extern int func_80131A34(int a0, int a1);
extern void func_80130AF0(int param_1);
extern void (*D_8018B8FC[])(void);
extern void func_80130D0C(void *a0);
extern s32 rand(void);
extern u8 D_80078E78[];
extern u16 D_80078EB2;
extern u16 D_80078EB4;
extern s16 D_8018B94C[];
extern s16 D_8018B97C[];
extern s16 D_8018B9DC[];
extern s16 D_8018B9E4[];
extern s16 D_8018BA04[];
extern void func_80130D48(s32 arg0);
extern void func_80131170(s32 p, s32 b, s32 c);
extern s32 func_801312D0(s32 param_1, void *param_2);
extern void func_80131E00();
extern s32 D_801E9528;
extern s32 D_801E952C;
extern void func_8002A04C(s32 a0);
extern void func_801319E0(s32 arg0);
extern s32 func_80131CF4(s32 a0);
extern int func_80131D68(int a0, int a1);
extern void (*D_8018BA3C[])(struct S80131E00 *a0);
extern void func_80131E38(u8 *a0);
extern void func_80131E7C(s32 a0);
extern void func_80131EE4(void);
extern void (*D_8018BA94[])(void);
extern void func_80131EEC(void *a0);
extern void (*D_8018BADC[])(void);
extern void func_80131F28(void *a0);
extern void (*D_8018BAE4[])(void);
extern void func_80131F64(void *a0);
extern void (*D_8018BAEC[])(void);
extern void func_80131FA0(void *a0);
extern void (*D_8018BAF4[])(void);
extern void func_80131FDC(void *a0);
extern void func_801320D0(void);
extern void func_8001C214(int, int);
extern int D_8018BA9C;
extern void func_801320D8(int param_1);
extern s32 func_80132144(s32 param_1);
extern int D_8018BABC;
extern void func_801321B0(int param_1);
extern int D_8018BACC;
extern void func_8013221C(int param_1);
extern void func_8005C324(int dst, int src, int n) __asm__("memcpy"); /* Phase-24: 0x8005C324 is named memcpy for overlays (whale needs it); keep the non-builtin C name here (else built-in codegen), emit via asm-label */
extern void func_801325B8(int a0, int a1, int a2, int a3, int a4);
extern void func_80132288(int *param_1, int *param_2, int param_3);
extern void func_801325B8(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4);
extern void func_8013240C(s32 a0);
extern void memcpy();
extern void gteMIMefunc();
extern void func_801325B8(int dst, int src, int m0, int mm, int arg5);
extern void func_8013277C(void);
extern void func_80020F34(s32 a0, s32 a1);
extern void func_80054514(s32 a0, s32 a1);
extern void func_80132784(s32 a0, s32 a1, u32 a2);
extern s32 VectorNormalSS(void *a0, void *a1);
extern void func_80132DC4(s32 a0, s32 a1, s32 a2);
extern s32 func_80132E6C(s16 *a0);
extern void func_80132EC4(void *a0, s16 a1);
extern s32 func_80132EF4(s32 a0, s32 a1);
extern void func_801330E0(void * param_1, s16 * param_2, s32 param_3);
extern void func_80133060(u8 *a0, s32 *a1, s32 a2);
extern void func_8013339C(short *param_1, short *param_2);
extern s32 func_8013361C(s16 *a0, s16 *a1, s16 *a2, s16 *a3);
extern s32 D_801E9570;
extern s32 D_801E9574[];
extern int D_801E9578;
extern void func_80136BC4(s32 a0);
extern void func_801336E8(void *a0, int a1, int a2);
extern void func_80136BC4(s32);
extern void func_8013373C(s16 arg0);
extern s32 func_80133784(s32 arg0, void *arg1, s32 arg2);
extern s32 func_80133CD4();
extern s32 func_80134310(Vec3s *a0, Vec3s *a1, s32 a2);
extern s32 func_8013435C(s16 *a0, s16 *a1, s32 a2, s16 *a3);
extern s32 func_801343C4(s32 angle, s32 p1, s32 p2);
extern s32 func_80134510(s32 param);
extern s32 func_801345F8(s32 arg);
extern s32 func_801347A0(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_80134A28(s32 a0, s32 a1, s32 a2);
extern int func_80134A74(int param_1, s16 param_2, s16 param_3, int param_4);
extern s32 func_80134C20(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_80134FB8(s32 a0, s32 a1, s32 a2);
extern s32 func_80135004(s32 arg0, s32 p1, s32 p2);
extern u8 D_8018BB00;
extern u8 D_8018BAFC;
extern s16 *D_8018BB04;
extern u8 D_8018BB08;
extern int D_801E9570;
extern u16 D_801E9580;
extern int func_80134A74(int, s16, s16, int);
extern int func_80135168(u16 arg0, u16 *p1, u16 *p2);
extern s16 func_80135480(void *param_1, s32 param_2, s16 *param_3, s16 *param_4);
/* ==== end §8b carried decl layer ==== */
s32 func_80135A4C(s32 a0, s32 a1, s32 *a2, s32 a3) {
typedef struct { s8 c[8]; } Blk8;
extern s16 func_80135480(void *param_1, s32 param_2, s16 *param_3, s16 *param_4);
extern s32 func_80135EB0(void *arg0, s32 arg1_);
extern s32 func_80136A94(s32 a0, s32 a1, s32 a2, s32 a3);
extern s32 func_80133AB0(s16, s16, s16, s32);
extern u8 D_8018BAFC;
extern u8 D_8018BB00;
extern s16 *D_8018BB04;
extern s16 D_801E957C;
extern u16 D_801E9580;
extern s32 D_801E9584;
extern s32 D_801E95A4;
extern u8 D_801152A8[];
extern u8 D_801152B0;
s32 *p;
register s32 s7 __asm__("$23");
s32 flag;
s32 acc;
s16 i;
s32 eq;
s32 ret;
s32 frame_pad[8];
(void)&frame_pad;
switch (((s32 (*)(void))func_80135480)()) {
case 0:
return 0;
case 1:
s7 = a0 + 0x34;
p = (s32 *)((a1 & 0xFFFFFFF) | 0x80000000);
flag = 0;
break;
case 2:
s7 = a0 + 0x34;
p = (s32 *)((a1 & 0xFFFFFFF) | 0x80000000);
flag = 1;
break;
case 3:
s7 = a0 + 0x34;
p = (s32 *)&D_801E95A4;
flag = 0;
break;
case 4:
s7 = (s32)&D_801E9584;
p = (s32 *)&D_801E95A4;
flag = 1;
break;
}
acc = 0;
if (a1 < 0) {
if (func_80135EB0(p, -0x8000) == 0) {
p = (s32 *)*p;
if (p == 0) return 0;
loop:
if (func_80135EB0(p, -0x8000) == 0) goto next;
}
docall:
func_80136A94(flag, a0, a3, s7);
return 1;
next:
p = (s32 *)*p;
__asm__ __volatile__("");
if (p != 0) goto loop;
return 0;
}
i = 0;
*(s16 *)((*(u8 **)&D_8018BAFC) + 6) = -0x7FFF;
*(s16 *)((*(u8 **)&D_8018BB00) + 6) = 0x7FFF;
D_801E9580 = 0;
D_801E957C = 0;
{
s32 t = 0;
if (((V3 *)a2)->x == ((V3 *)a3)->x && ((V3 *)a2)->y == ((V3 *)a3)->y) {
s32 zt = (((V3 *)a2)->z == ((V3 *)a3)->z);
__asm__("addu %0,%1,$zero" : "=r"(t) : "r"(zt));
}
eq = t;
}
while (1) {
ret = func_80133AB0(0, (s16)(*(Box **)&D_8018BAFC)->f0, (s16)(*(Box **)&D_8018BAFC)->f4, (s32)p);
if (ret == 0) goto out;
acc |= ret;
if (eq != 0) goto out;
{
s16 old = i;
i = i + 1;
if (old >= 5) return 0;
}
}
out:
if ((s16)acc != 0 || D_801E957C != 0) {
if ((*(Box **)&D_8018BAFC)->f6 >= -0xBCB) {
*(Blk8 *)D_801152A8 = *(Blk8 *)&D_801152B0;
}
(*(Box **)&D_8018BB04)->f0 = (*(Box **)&D_8018BB00)->f0;
(*(Box **)&D_8018BB04)->f2 = (*(Box **)&D_8018BB00)->f2;
(*(Box **)&D_8018BB04)->f4 = (*(Box **)&D_8018BB00)->f4;
goto docall;
}
return 0;
}
-520
View File
@@ -1,520 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
DEFINE_func_80135D20() /* dedup: shared engine-core @0x80135D20 (src/shared) */
// @class: struct
// @stuck: none — MATCH (289 ins). symcheck: only the cosmetic jtbl_801D81B8 floor (§8 carve).
//
// func_80135EB0 — h_seq family exemplar (x138 across the overlay fleet). Levers that made it:
// 1. m2 (the y-axis mask) MUST be the if/else form, NOT `m2=0x10; if (a8<=t3) m2=...`.
// Both emit the same compact `bnez; li $s2,0x10` pair, but the pre-init form lets CSE carry
// the D_8018BAFC pointer load into the (m1|m2)==0 block; the if/else form ends the CSE
// extended-BB so the block reloads `lui/lw D_8018BAFC` (target does). Worth 2 ins + the whole
// big-block register assignment.
// 2. Zero-byte `__asm__ __volatile__("")` fences in case 1 and case 2 (DIFFERENT templates, "" vs " ")
// block gcc-2.7.2 cross_jump from folding those two bodies into case 6's second-call tail
// (they are byte-identical to it; the target keeps all three copies). Worth 10 ins.
// 3. Zero-byte fences between the three big-block coordinate groups stop sched2 hoisting the next
// group's `lhu` into the previous group's load-delay nop (restores 2 nops).
// 4. `D_801152AA = 0;` AFTER the h0 statement: it shortens the [6]-field temp's local-alloc live
// range so c0 wins $v1 and the field temps take $v0/$a0 (target), not $v1/$v0.
// 5. case 4 reaches case 8's tail through a shared `L288` label using `w = x << 16` / `w >> 16`
// so the shared block is exactly `sra $a1,$a1,16` — that is target's .L80136288. `w` pinned to
// $a1 ($5); it never spans a jal so §74 does not apply.
// 6. arg1 copied into a $s3-pinned local — without it global-alloc gives arg1 $s2 and m2 $s3
// (arg1 has more refs; target's priority order is arg0, sext-temp, m2, arg1).
// 7. `ret0:` sits between case 8 and case 10 and `done:`/`case 0:` after case 10 — that is the
// target's basic-block order; reorg then produces the inline `move $v0,$zero` delay slots.
DEFINE_func_80135EB0() /* dedup: shared engine-core @0x80135EB0 (src/shared) */
s32 func_80136334(void *arg0, s32 arg1, s32 arg2) {
extern u8 D_801152A8[];
extern s16 D_801152AA;
extern s16 D_801152AC;
extern s16 D_80126722;
extern s16 D_80126724;
register s32 a1v __asm__("$11");
register s32 a2v __asm__("$12");
register s32 n __asm__("$5");
register s16 *b4 __asm__("$7");
s32 d;
s32 dx;
s32 denom;
s32 result;
s32 frame_pad[2];
(void)&frame_pad;
__asm__("" : "=r"(a1v) : "0"(arg1));
a2v = arg2;
if (!(arg1 & 1)) {
dx = (s16) arg2 - (*(s16 **)&D_8018BAFC)[2];
d = dx;
denom = -(*(s16 **)&D_8018BB08)[2];
} else {
denom = (*(s16 **)&D_8018BB08)[2];
d = (*(s16 **)&D_8018BAFC)[2] - (s16) arg2;
dx = -d;
}
n = -d;
{
register s16 *b8 __asm__("$6") = *(s16 **)&D_8018BB08;
u16 *ac = *(u16 **)&D_8018BAFC;
b4 = D_8018BB04;
b4[0] = ac[0] + n * b8[0] / denom;
b4[1] = ac[1] + n * b8[1] / denom;
b4[2] = ac[2] + dx;
}
if (b4[0] < M2C_FIELD(arg0, s16 *, 4)) return 0;
if (M2C_FIELD(arg0, s16 *, 6) < b4[0]) return 0;
if (b4[1] < M2C_FIELD(arg0, s16 *, 8)) return 0;
if (M2C_FIELD(arg0, s16 *, 0xA) < b4[1]) return 0;
if (a1v & 0x8000) {
u16 *b0 = *(u16 **)&D_8018BB00;
b4[0] = b0[0];
b4[1] = b0[1];
}
D_801152AA = 0;
(*(s16 *)D_801152A8) = 0;
if (a1v & 1) {
D_8018BB04[2] = a2v + 2;
__asm__ __volatile__("");
D_801152AC = 0xFFF;
} else {
D_801152AC = -0xFFF;
D_8018BB04[2] = a2v - 2;
}
__asm__ __volatile__("" :: "r"(a1v), "r"(a2v));
(*(s16 *)D_80126720) = (M2C_FIELD(arg0, s16 *, 4) + M2C_FIELD(arg0, s16 *, 6)) >> 1;
D_80126722 = (M2C_FIELD(arg0, s16 *, 8) + M2C_FIELD(arg0, s16 *, 0xA)) >> 1;
result = 1;
D_80126724 = (M2C_FIELD(arg0, s16 *, 0xC) + M2C_FIELD(arg0, s16 *, 0xE)) >> 1;
return result;
}
// @class: regalloc-order — per-location family member of ov_SC01_077 exemplar func_801365B8 (x134).
// @stuck: none — MATCH expected; identical structure, only the 4 data ptrs differ (AC/B0/B4/B8 -> B64/68/6C/70).
// D_8018BAFC/68/70 file-scope `extern u8` holding pointers -> read via *(T**)&sym (§42c-2).
// D_8018BB04 file-scope `extern s16*` -> use directly. D_80126720 file-scope `extern u8[]`
// -> single store via *(s16*)D_80126720. D_801152A8/AA/AC, D_80126722/24 block-scope externs
// (siblings use block-scope; gcc-2.7.2 does not cross-conflict block-scope externs).
DEFINE_func_801365B8() /* dedup: shared engine-core @0x801365B8 (src/shared) */
// @class: pointer-type — pointer-vs-array reconcile for func_80136824 (ov_SC01_077_a)
// D_8018BAFC/B0/B8 are file-scope `extern u8`, D_8018BB04 is `extern s32 []`; each HOLDS a
// pointer value that the target loads via lw then derefs. Read as pointer via *(T**)&sym.
// D_8018BB04 must be a SCALAR pointer (not s32[]) — as an array it decays and gcc CSEs the
// base address into a held reg (lui;addiu;lw 0(reg)) across the 3 reloads; as a scalar
// pointer it folds %lo (lui;lw %lo). Retype all 3 file-TU occurrences (byte-neutral: the
// siblings read it once via *(u16**)&sym == direct lw either way).
s32 func_80136824(s32 arg0, s32 arg1, s32 arg2) {
extern u8 D_801152A8[];
extern s16 D_801152AA;
extern s16 D_801152AC;
extern s16 D_80126722;
extern s16 D_80126724;
register u16 *ac __asm__("$4");
register s16 *b8 __asm__("$6");
register s16 *b4 __asm__("$9");
register s32 r __asm__("$3");
register s32 pos __asm__("$12");
register s32 a1v __asm__("$5");
s16 temp_v0;
s16 temp_v1;
s32 var_a3;
s16 var_v0_3;
s32 temp_a1;
s32 var_t0;
s32 var_v1;
s16 *b4b;
u16 *p;
__asm__ ("" : "=r"(a1v) : "0"(arg1));
pos = arg2;
if (!(a1v & 1)) {
var_t0 = (s16) arg2 - (*(s16 **)&D_8018BAFC)[1];
var_v1 = var_t0;
var_a3 = -(*(s16 **)&D_8018BB08)[1];
} else {
var_a3 = (*(s16 **)&D_8018BB08)[1];
var_v1 = (*(s16 **)&D_8018BAFC)[1] - (s16) arg2;
var_t0 = -var_v1;
}
b8 = (*(s16 **)&D_8018BB08);
ac = (*(u16 **)&D_8018BAFC);
b4 = D_8018BB04;
temp_a1 = -var_v1;
r = (temp_a1 * b8[0]) / var_a3;
b4[0] = ac[0] + r;
b4[1] = ac[1] + var_t0;
r = (temp_a1 * b8[2]) / var_a3;
temp_v0 = ac[2] + r;
b4[2] = temp_v0;
temp_v1 = b4[0];
if (temp_v1 < M2C_FIELD(((void *)arg0), s16 *, 4)) {
return 0;
}
if (M2C_FIELD(((void *)arg0), s16 *, 6) < temp_v1) {
return 0;
}
if (temp_v0 < M2C_FIELD(((void *)arg0), s16 *, 0xC)) {
return 0;
}
if (M2C_FIELD(((void *)arg0), s16 *, 0xE) < temp_v0) {
return 0;
}
if (arg1 & 0x8000) {
p = (*(u16 **)&D_8018BB00);
b4[0] = (s16) p[0];
b4[2] = (s16) p[2];
}
D_801152AC = 0;
(*(s16 *)D_801152A8) = 0;
if (arg1 & 1) {
b4b = D_8018BB04;
D_801152AA = 0xFFF;
__asm__ __volatile__("");
var_v0_3 = pos + 2;
} else {
b4b = D_8018BB04;
D_801152AA = -0xFFF;
__asm__ __volatile__("");
var_v0_3 = pos - 2;
}
b4b[1] = var_v0_3;
__asm__ __volatile__("" :: "r"(pos));
(*(s16 *)D_80126720) = (s16) ((s32) (M2C_FIELD(((void *)arg0), s16 *, 4) + M2C_FIELD(((void *)arg0), s16 *, 6)) >> 1);
D_80126722 = (s16) ((s32) (M2C_FIELD(((void *)arg0), s16 *, 8) + M2C_FIELD(((void *)arg0), s16 *, 0xA)) >> 1);
D_80126724 = (s16) ((s32) (M2C_FIELD(((void *)arg0), s16 *, 0xC) + M2C_FIELD(((void *)arg0), s16 *, 0xE)) >> 1);
return 1;
}
// @class: schedule
// @stuck: none — MATCH (76 ins, relocation-masked). Key lever: the D_80126720/22/24 tail is a
// global-short RMW `+=`. Writing it via a cast `*(u16*)&SYM = *(u16*)&SYM + x` makes gcc CSE
// the address into a base reg (base-reuse) for ALL three — but the target only base-reuses
// D_80126720 (a SCHEDULER artifact: its addr-lui fills the load-delay slot after the pb4[4]
// load, and since $v0 is live it lands in $a0, reused for load+store). D_80126722/24 use the
// plain inline 2-lui form. Fix = DIRECT scalar RMW `SYM = SYM + x` (no &/cast) → inline %hi/%lo;
// the scheduler alone forces base-reuse on #1. Also: `s16 D_80126724 = D_80126724 + int` emits
// LHU (gcc-2.7.2 drops the sign-extend because the sum is truncated to 16b on the sh) — so the
// canonical s16 decl is byte-safe here (no u16 retype needed, keeps the sign-sensitive callers).
extern s16 *D_8018BB04; /* holds a pointer value (*(u16**)&D_8018BB04) */
s32 func_80136A94(s32 a0, s32 a1, s32 a2, s32 a3) {
extern void ApplyMatrixSV(void *m, void *v0, void *v1);
extern void ApplyRotMatrix(void *v0, void *v1);
extern u16 D_80126722;
extern s16 D_80126724;
extern s16 D_801152AA;
extern s16 D_801152AC;
s32 out[4];
u16 *pb4;
if (a0) {
ApplyMatrixSV((void *)a3, *(void **)&D_8018BB04, *(void **)&D_8018BB04);
ApplyMatrixSV((void *)a3, (void *)D_80126720, (void *)D_80126720);
ApplyRotMatrix((void *)D_801152A8, (void *)out);
*(s16 *)D_801152A8 = out[0];
D_801152AA = out[1];
D_801152AC = out[2];
}
pb4 = *(u16 **)&D_8018BB04;
*(s16 *)(a2) = pb4[0] + *(s32 *)(a1 + 0x48);
*(s16 *)(a2 + 2) = pb4[1] + *(s32 *)(a1 + 0x4C);
*(s16 *)(a2 + 4) = pb4[2] + *(s32 *)(a1 + 0x50);
*(u16 *)D_80126720 = *(u16 *)D_80126720 + *(s32 *)(a1 + 0x48);
D_80126722 = D_80126722 + *(s32 *)(a1 + 0x4C);
D_80126724 = D_80126724 + *(s32 *)(a1 + 0x50);
}
DEFINE_func_80136BC4() /* dedup: shared engine-core @0x80136BC4 (src/shared) */
DEFINE_func_80136C1C() /* dedup: shared engine-core @0x80136C1C (src/shared) */
DEFINE_func_80136C3C() /* dedup: shared engine-core @0x80136C3C (src/shared) */
DEFINE_func_80136C44() /* dedup: shared engine-core @0x80136C44 (src/shared) */
DEFINE_func_80136C4C() /* dedup: shared engine-core @0x80136C4C (src/shared) */
DEFINE_func_80136C54() /* dedup: shared engine-core @0x80136C54 (src/shared) */
// @class: struct
// @stuck: none — MATCH (28 ins). 10-byte 1-aligned struct copy (S10_80136C90{char s[10]}) from global D_801E83F0 into a stack buffer, then func_8001534C(0,&buf,0x78,0x10,0,0). gcc emits the block move as 2 unaligned words (lwl/lwr+swl/swr) + 2 bytes (lb/sb).
s32 func_80136C90()
{
extern void func_8001534C(int, void *, int, int, int, int);
extern S10_80136C90 D_801E83F0;
S10_80136C90 buf = D_801E83F0;
func_8001534C(0, &buf, 0x78, 0x10, 0, 0);
}
DEFINE_func_80136D00() /* dedup: shared engine-core @0x80136D00 (src/shared) */
DEFINE_func_80136D08() /* dedup: shared engine-core @0x80136D08 (src/shared) */
DEFINE_func_80136DFC() /* dedup: shared engine-core @0x80136DFC (src/shared) */
DEFINE_func_80136EC4() /* dedup: shared engine-core @0x80136EC4 (src/shared) */
DEFINE_func_80136ECC() /* dedup: shared engine-core @0x80136ECC (src/shared) */
DEFINE_func_80136F3C() /* dedup: shared engine-core @0x80136F3C (src/shared) */
DEFINE_func_80137030() /* dedup: shared engine-core @0x80137030 (src/shared) */
DEFINE_func_80137178() /* dedup: shared engine-core @0x80137178 (src/shared) */
DEFINE_func_801372B0() /* dedup: shared engine-core @0x801372B0 (src/shared) */
DEFINE_func_801375EC() /* dedup: shared engine-core @0x801375EC (src/shared) */
extern void func_801375EC(s32 a0, s16 a1);
// @class: schedule (arg-copy placement) — PIN-FREE
// match_one: MATCH (26 ins). rtu: MATCH (26 ins) with NO //@EDIT and NO header edit.
//
// ---- RECONCILE 2026-08-01 (uc2 -> uc3) ---------------------------------------------------
// GATE ERROR was:
// jr_80135D20.c:1412 conflicting types for func_80137614 || :1362 previous declaration
// :1362 is `DEFINE_func_801375EC()`, whose expansion (src/shared/engine_core.h:2819) carries
// extern void func_80137614(s32 a0, s32 a1, s32 a2);
// and it is instantiated two lines ABOVE this function's INCLUDE_ASM splice point (:1364).
// :1412 is this draft's own definition. So the conflicting symbol is func_80137614 ITSELF
// and the axis is the §73 RETURN type: the shared header says `void`, the target ends
// `addu $v0, $s0, $zero` and callers in other overlays consume the result
// (ov_SC03_099_jr_80178D40.c already declares it `extern s32 func_80137614(s32,s32,s32)`),
// so the definition MUST stay s32. Re-voiding the definition is the decay loop: gcc-2.7.2
// silently drops the $v0 set and you get 25/26 ins, class LENGTH-DRIFT/-1.
//
// ESCAPE USED: §37/§124 ASM-LABEL ALIAS (escape #2). The definition is given a distinct C
// identifier `aF80137614` with __asm__("func_80137614"), so it never collides with the
// header's `extern void func_80137614` while still emitting the canonical symbol. Zero
// header edits, zero TU edits, blast radius 0 — this replaces uc2's //@EDIT §65b de-macroize
// of DEFINE_func_801375EC, which would have had to be repeated at all 138 sweep sites.
// The TU already uses this exact idiom 60-odd lines below
// (`void *aF801376E8(int a0, int a1) __asm__("func_801376E8");`), so it travels to siblings.
// The in-TU call from func_801375EC still binds to the header's extern declaration and
// resolves to the same symbol at link time; func_801375EC's own 10 instructions are unchanged.
//
// ---- CODEGEN (unchanged from uc2 — do not touch) -----------------------------------------
// Residual before the lever: 4 mismatched, the (sw $sN / addu $sN,$aX) prologue PAIRS mirrored —
// target births $s2<-a2 then $s3<-a1; the naive draft births $s3<-a1 then $s2<-a2 (parm order),
// and drags `sw $s3` above `sw $s2` with it. Register ASSIGNMENT was already right in both, so
// this is NOT a regalloc problem. Measured INERT: body statement order, extra plain locals,
// K&R parm-declaration order (incl. declaring a2 before a1 in the K&R decl block).
//
// LEVER — cookbook §67 (arg-copy PLACEMENT). One zero-instruction launder of the a1 parameter
// pins WHERE its entry copy materialises; a2's copy then takes the earlier slot and the register
// saves fall back into ascending order. DIRECTION MATTERS and is the opposite of the intuition:
// laundering a2 (the copy that must move EARLIER) is inert — launder the copy that must land
// LATER. §67 rule 1 respected: the laundered local is NOT pinned. A pinned variant
// (register s32 __asm__("$18") / __asm__("$19") on a2/a1) also MATCHes, but pins are strictly
// worse for the ×138 family sweep (§42e/§86 pin guard), so the pin-free single launder is banked.
//
// Shape copied from the matched next-door sibling DEFINE_func_8013767C() (engine_core.h),
// which is this function minus the 0xD8 mask and the +0x1C halfword store.
extern s32 func_801399A8(void);
extern void func_801377B4(s32 a0, s32 a1, s32 a2);
s32 aF80137614(s32 a0, s32 a1, s32 a2) __asm__("func_80137614");
DEFINE_func_80137614() /* dedup: shared engine-core @0x80137614 (src/shared) */
DEFINE_func_8013767C() /* dedup: shared engine-core @0x8013767C (src/shared) */
DEFINE_func_801376C8() /* dedup: shared engine-core @0x801376C8 (src/shared) */
/* @class: plumbing (globals-around-two-calls)
* @stuck: none — MATCH (51 ins).
*
* RECONCILE (§37/§124 ASM-LABEL ALIAS) — no TU / header edit required.
* Gate error: ov_SC01_077_jr_80135D20.c:1415: conflicting types for `func_801376E8'
* || previous declaration at :1368
* :1368 is DEFINE_func_801376C8(), the shared engine-core macro that carries
* `extern void func_801376E8(int a0, int a1);` — a VOID return. The target's last
* pre-epilogue instruction is `addu $v0, $s1, $zero`, i.e. it RETURNS &D_801269F0,
* so the definition MUST be non-void; a `void` definition makes gcc-2.7.2 merely warn
* and DROP the returned value, killing that instruction (LENGTH-DRIFT/-1, 50 ins).
* The conflict is on func_801376E8 ITSELF and is a pure RETURN-type disagreement
* (params already agree: int,int), so the §37/§124 alias applies verbatim:
* define under the C name aF801376E8 with __asm__("func_801376E8") so the C-level
* declaration never collides, while the emitted symbol is still func_801376E8.
* Codegen is untouched — an asm label renames the symbol, nothing else.
* (The earlier draft's `//@EDIT` widening of the shared extern to `void *` is a
* T2 fleet-shared edit; the alias is T0 draft-only. Cookbook §124: fix the reader,
* not the source.)
*
* Byte levers (unchanged from the passing draft):
* - `obj` local holding (s32)&D_801269F0: the address is CSEd ONCE into $s1 and reused
* for both jal args and the return (same idiom as the neighbouring func_80137B80).
* - D_80126A24 is s16 (`lh`) but D_80126A26 is u16 (`lhu`) with an explicit (s16) cast
* at the use site: gcc combines the cast's `sll 16; sra 16` with the `>>1` into
* `sll 16; sra 17`, which is exactly what the target emits. A plain s16 D_80126A26
* would give `lh; sra 1` instead.
* - D_80126A14 as u16[2] (`lhu` loads, `%lo(D_80126A14 + 0x2)` for element 1).
*/
extern void func_801377B4(s32 a0, s32 a1, s32 a2);
extern void func_80139BE0(s32 a0);
void *aF801376E8(int a0, int a1) __asm__("func_801376E8");
DEFINE_func_801376E8() /* dedup: shared engine-core @0x801376E8 (src/shared) */
DEFINE_func_801377B4() /* dedup: shared engine-core @0x801377B4 (src/shared) */
DEFINE_func_80137840() /* dedup: shared engine-core @0x80137840 (src/shared) */
extern void func_80016714(void *a0, s32 a1);
extern void func_8013A860(void);
void func_801378F0(void) {
extern u8 D_80127520[];
extern u8 aD801269F0[] __asm__("D_801269F0"); /* §37 alias: TU canon is `extern int D_801269F0` */
extern u8 D_80126A28[];
extern u8 D_8018BB20[];
s32 i;
s32 si;
s32 di;
u8 *p;
func_80016714(D_80127520, 0xBFC);
i = 0;
si = 0;
p = aD801269F0;
di = 0;
do {
func_80016714(p, 0x4C);
*(u16 *)&D_80126A28[di] = *(u16 *)&D_8018BB20[si];
*(u16 *)&D_80126A28[di + 2] = *(u16 *)&D_8018BB20[si + 2];
*(u16 *)&D_80126A28[di + 4] = *(u16 *)&D_8018BB20[si + 4];
*(u16 *)&D_80126A28[di + 6] = *(u16 *)&D_8018BB20[si + 6];
p += 0x4C;
i += 1;
si += 8;
di += 0x4C;
} while (i < 3);
func_8013A860();
}
DEFINE_func_801379D8() /* dedup: shared engine-core @0x801379D8 (src/shared) */
DEFINE_func_801379EC() /* dedup: shared engine-core @0x801379EC (src/shared) */
// @class: regalloc-order (walker-family, §52/§52a) — PIN-FREE
// Role-swap ($s0<->$s2 between loop1 and loops2/3) is driven by DENSITY (K2), not pins:
// - loop1 pointer has an extra ref (p != D_80127524 compare) -> wins $s0; index -> $s2
// - loop2/3 index has >= pointer refs -> wins $s0; pointer -> $s2
// Separate per-loop pointer/index vars => separate pseudos => can take different regs.
DEFINE_func_801379FC() /* dedup: shared engine-core @0x801379FC (src/shared) */
// @class: remat
// @stuck: target CSEs &D_801269F0 once for load+call arg; force via local pointer
extern s32 D_80127548[];
extern int D_8018BB6C;
extern int D_801269F0;
extern void func_80138BE0(int p);
void func_80137B80(void) {
int *p = &D_801269F0;
(*(int *)&D_80127548) = 0x24;
if (*p != 0) {
((void (*)(int *))func_80138BE0)(p);
}
D_8018BB6C += 1;
}
DEFINE_func_80137BD8() /* dedup: shared engine-core @0x80137BD8 (src/shared) */
// @class: plumbing
// @stuck: none — MATCH (51 ins). Three globals stored/loaded around 3 calls; &D_801269F0 held in $s1, arg1 in $s0 across calls; return reloads global D_800A5E60.
extern unsigned char D_80126A0E;
extern short D_80126A0A;
extern s16 D_801269F4;
extern int D_800A5E60;
extern int D_8018BB6C;
extern int D_801269F0;
extern void func_801392FC();
extern void func_80137DD4(s32 a0, u8 *a1, u8 *a2);
extern void func_80139680(s32 a0, u8 *a1);
int func_80137D08(int arg0, int arg1, short arg2)
{
unsigned char buf[3];
D_800A5E60 = arg0;
D_80126A0A = arg2;
((void (*)(void *, int, int))func_801392FC)(&D_801269F0, D_80126A0E, arg1);
if ((*(short *)&D_801269F4) == 7) {
buf[0] = 0x39;
buf[1] = 0xFF;
buf[2] = 0x71;
((void (*)(void *, void *, int))func_80137DD4)(&D_801269F0, buf, arg1);
} else if ((*(short *)&D_801269F4) == 3) {
if (D_8018BB6C & 4) {
((void (*)(void *, int))func_80139680)(&D_801269F0, arg1);
}
}
return D_800A5E60;
}
DEFINE_func_80137DD4() /* dedup: shared engine-core @0x80137DD4 (src/shared) */
DEFINE_func_80137FD8() /* dedup: shared engine-core @0x80137FD8 (src/shared) */
-409
View File
@@ -1,409 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
DEFINE_func_801380E0() /* dedup: shared engine-core @0x801380E0 (src/shared) */
DEFINE_func_801387B8() /* dedup: shared engine-core @0x801387B8 (src/shared) */
DEFINE_func_80138948() /* dedup: shared engine-core @0x80138948 (src/shared) */
DEFINE_func_8013895C() /* dedup: shared engine-core @0x8013895C (src/shared) */
DEFINE_func_80138AB4() /* dedup: shared engine-core @0x80138AB4 (src/shared) */
DEFINE_func_80138B88() /* dedup: shared engine-core @0x80138B88 (src/shared) */
// @class: struct
// @stuck: none — MATCH (match_one: MATCH 20 ins)
extern void (*D_8018BB70[])(void);
void func_80138BE0(int p)
{
if (*(unsigned short *)(p + 0xe) != 0) {
*(unsigned short *)(p + 0xe) -= 1;
}
D_8018BB70[*(short *)(p + 4)]();
}
void func_80138C30(void *a0) {
if (*(s16 *)((s32)a0 + 4) == 4) {
*(s16 *)((s32)a0 + 4) = 2;
} else {
*(u32 *)((s32)a0 + 8) |= 0x800;
}
}
extern s32 func_80139BE0(s32);
s32 func_80138C60(s32 arg0)
{
extern Q_80138C60 D_8018BB3C[];
u16 t;
u8 b;
s32 f;
s32 idx;
if (*(s32 *)(arg0 + 8) & 0x2000) {
return 1;
}
t = *(u8 *)(arg0 + 0x22) & 7;
*(s16 *)(arg0 + 0x18) = t;
if (t < 2) {
*(u8 *)(arg0 + 0x20) = 0;
}
f = *(s32 *)(arg0 + 8);
if (f & 0x40) {
*(u8 *)(arg0 + 0x22) = (*(u8 *)(arg0 + 0x22) & 0x67) | (f & ~0x67);
}
b = *(u8 *)(arg0 + 0x22);
if (b & 0x80) {
idx = (b & 0x18) >> 3;
} else {
idx = (b & 0x78) >> 3;
if (b & 0x60) {
*(s16 *)(arg0 + 0x1C) = 0;
}
}
*(Q_80138C60 *)(arg0 + 0x24) = D_8018BB3C[idx];
func_80139BE0(arg0);
func_80139C7C((u8 *)arg0);
return func_8013A8FC(arg0);
}
DEFINE_func_80138D58() /* dedup: shared engine-core @0x80138D58 (src/shared) */
DEFINE_func_80138DB8() /* dedup: shared engine-core @0x80138DB8 (src/shared) */
DEFINE_func_80138DE0() /* dedup: shared engine-core @0x80138DE0 (src/shared) */
DEFINE_func_80138ED0() /* dedup: shared engine-core @0x80138ED0 (src/shared) */
DEFINE_func_8013914C() /* dedup: shared engine-core @0x8013914C (src/shared) */
DEFINE_func_801391F0() /* dedup: shared engine-core @0x801391F0 (src/shared) */
DEFINE_func_80139220() /* dedup: shared engine-core @0x80139220 (src/shared) */
DEFINE_func_801392C8() /* dedup: shared engine-core @0x801392C8 (src/shared) */
DEFINE_func_801392FC() /* dedup: shared engine-core @0x801392FC (src/shared) */
DEFINE_func_801395D4() /* dedup: shared engine-core @0x801395D4 (src/shared) */
DEFINE_func_80139634() /* dedup: shared engine-core @0x80139634 (src/shared) */
DEFINE_func_80139680() /* dedup: shared engine-core @0x80139680 (src/shared) */
DEFINE_func_80139788() /* dedup: shared engine-core @0x80139788 (src/shared) */
DEFINE_func_801397B0() /* dedup: shared engine-core @0x801397B0 (src/shared) */
DEFINE_func_80139914() /* dedup: shared engine-core @0x80139914 (src/shared) */
DEFINE_func_80139954() /* dedup: shared engine-core @0x80139954 (src/shared) */
DEFINE_func_801399A8() /* dedup: shared engine-core @0x801399A8 (src/shared) */
DEFINE_func_801399F0() /* dedup: shared engine-core @0x801399F0 (src/shared) */
DEFINE_func_80139A34() /* dedup: shared engine-core @0x80139A34 (src/shared) */
DEFINE_func_80139A44() /* dedup: shared engine-core @0x80139A44 (src/shared) */
DEFINE_func_80139A68() /* dedup: shared engine-core @0x80139A68 (src/shared) */
DEFINE_func_80139A8C() /* dedup: shared engine-core @0x80139A8C (src/shared) */
DEFINE_func_80139B18() /* dedup: shared engine-core @0x80139B18 (src/shared) */
/* func_80139BE0 — ov_SC01_077 / ov_SC01_077_jr_801380E0, 39 ins, MATCH.
*
* REDRAFT of the decayed backlog draft: the stored draft was -1 instruction
* (LENGTH-DRIFT) because the target keeps a QI->SI zero-extend of the masked
* byte (`andi $a1,$v0,0xFF` after `andi $v0,$v0,0x60`) that gcc-2.7.2 folds
* away: combine proves nonzero_bits(x & 0x60) <= 0xff and simplifies the
* extend to nothing. No pure-C spelling survives that fold when the def and
* the extend sit in the SAME basic block (verified: u8 local, (u8) cast at
* the use, `& 0xff` at the use, u8-via-int, u16 hold, hard-register pins) —
* a cross-BB def keeps it but lands the andi in the wrong block.
* The opacity idiom (already used in src/ov_SC03_099) makes the value's range
* unprovable in place, so the extend survives at its original position.
* cookbook §1/I2 ("masked andi survives only if the value's range is
* unprovable"), §17 (pins/barriers).
*/
s32 func_80139BE0(int param_1)
{
extern unsigned char D_8018BB38[];
int v;
if ((*(unsigned int *)(param_1 + 8) & 0x2000) == 0) {
int t = *(unsigned char *)(param_1 + 0x22) & 0x60;
int h = *(unsigned short *)(param_1 + 0x18);
unsigned int idx;
__asm__("" : "=r"(t) : "0"(t));
idx = (unsigned char)t;
if (h < 7) {
if (h >= 2) {
v = D_8018BB38[idx >> 5];
} else {
v = D_8018BB38[0];
}
} else {
v = D_8018BB38[0];
}
*(short *)(param_1 + 0x2e) = 3;
*(short *)(param_1 + 0x2c) = v;
}
*(short *)(param_1 + 0x34) = *(short *)(param_1 + 0x2c) * 6;
{
int x = *(short *)(param_1 + 0x2e);
*(short *)(param_1 + 0x36) = x * 12 + (x - 1) * 2;
}
}
DEFINE_func_80139C7C() /* dedup: shared engine-core @0x80139C7C (src/shared) */
DEFINE_func_80139D04() /* dedup: shared engine-core @0x80139D04 (src/shared) */
DEFINE_func_80139DC8() /* dedup: shared engine-core @0x80139DC8 (src/shared) */
DEFINE_func_80139DEC() /* dedup: shared engine-core @0x80139DEC (src/shared) */
DEFINE_func_80139DF4() /* dedup: shared engine-core @0x80139DF4 (src/shared) */
DEFINE_func_80139E84() /* dedup: shared engine-core @0x80139E84 (src/shared) */
DEFINE_func_80139F0C() /* dedup: shared engine-core @0x80139F0C (src/shared) */
DEFINE_func_80139FBC() /* dedup: shared engine-core @0x80139FBC (src/shared) */
DEFINE_func_80139FE8() /* dedup: shared engine-core @0x80139FE8 (src/shared) */
DEFINE_func_8013A0A4() /* dedup: shared engine-core @0x8013A0A4 (src/shared) */
DEFINE_func_8013A164() /* dedup: shared engine-core @0x8013A164 (src/shared) */
DEFINE_func_8013A1E8() /* dedup: shared engine-core @0x8013A1E8 (src/shared) */
DEFINE_func_8013A250() /* dedup: shared engine-core @0x8013A250 (src/shared) */
DEFINE_func_8013A2BC() /* dedup: shared engine-core @0x8013A2BC (src/shared) */
DEFINE_func_8013A378() /* dedup: shared engine-core @0x8013A378 (src/shared) */
DEFINE_func_8013A380() /* dedup: shared engine-core @0x8013A380 (src/shared) */
DEFINE_func_8013A448() /* dedup: shared engine-core @0x8013A448 (src/shared) */
DEFINE_func_8013A4C4() /* dedup: shared engine-core @0x8013A4C4 (src/shared) */
DEFINE_func_8013A530() /* dedup: shared engine-core @0x8013A530 (src/shared) */
DEFINE_func_8013A860() /* dedup: shared engine-core @0x8013A860 (src/shared) */
DEFINE_func_8013A8B0() /* dedup: shared engine-core @0x8013A8B0 (src/shared) */
DEFINE_func_8013A8BC() /* dedup: shared engine-core @0x8013A8BC (src/shared) */
DEFINE_func_8013A8FC() /* dedup: shared engine-core @0x8013A8FC (src/shared) */
DEFINE_func_8013A9B4() /* dedup: shared engine-core @0x8013A9B4 (src/shared) */
DEFINE_func_8013A9F8() /* dedup: shared engine-core @0x8013A9F8 (src/shared) */
DEFINE_func_8013AA24() /* dedup: shared engine-core @0x8013AA24 (src/shared) */
DEFINE_func_8013AB54() /* dedup: shared engine-core @0x8013AB54 (src/shared) */
// @class: schedule
// @stuck: none — MATCH (122 ins). GTE lerp+mvmva loop. Two levers: (1) flat `extern s16`
// source arrays indexed [2*i]/[2*i+1] force 4 separate walking IVs (t2/t3/t4/t5) instead of
// one shared offset-IV + symbol(reg) addressing; (2) INVERTED-arm if/else
// `if (flag<0) out3=-tbl; else out3=tbl;` gives the target's bgez polarity + reload-per-arm
// sign-flip block (a plain ?: hoists the common lbu; the inverted if/else does not, and gcc
// still merges the sb). out2[i]=out2[0] tail-copy of the align-2 Pair_8013AD38 emits lwl/lwr/swl/swr.
#include "common.h"
extern s16 D_800D45F4[]; /* src0 (flat: [2*i]=x, [2*i+1]=y) */
extern u8 D_8018BC3C[]; /* sign table, alt (when a1 < 0xC00) */
#define gte_ldv0(r0) __asm__ __volatile__( \
"lwc2 $0, 0(%0)\n" \
"lwc2 $1, 4(%0)\n" \
: : "r"(r0) : "memory")
#define gte_mvmva0() __asm__ __volatile__( \
"nop\n" \
"nop\n" \
"mvmva 1, 0, 0, 0, 0\n" \
: : : "memory")
#define gte_stlvnl(r0) __asm__ __volatile__( \
"swc2 $25, 0(%0)\n" \
"swc2 $26, 4(%0)\n" \
"swc2 $27, 8(%0)\n" \
: : "r"(r0) : "memory")
void func_8013AD38(void *flag, s32 a1, void *out2, void *out3)
{
extern s16 D_800D466C[];
extern u8 D_8018BC78[];
u8 *tbl;
s16 vec[4];
s32 res[3];
s32 i;
tbl = D_8018BC78;
if (((s16)a1) < 0xC00) {
tbl = D_8018BC3C;
}
for (i = 0; i < 30; i++) {
vec[0] = D_800D45F4[2 * i] + (((D_800D466C[2 * i] - D_800D45F4[2 * i]) * ((s16)a1)) >> 12);
vec[1] = D_800D45F4[2 * i + 1] + (((D_800D466C[2 * i + 1] - D_800D45F4[2 * i + 1]) * ((s16)a1)) >> 12);
gte_ldv0(vec);
gte_mvmva0();
gte_stlvnl(res);
((Pair_8013AD38 *)out2)[i].x = res[0];
((Pair_8013AD38 *)out2)[i].y = res[1];
if (((s16 *)flag)[0] < 0) ((s8 *)out3)[2 * i] = -tbl[2 * i]; else ((s8 *)out3)[2 * i] = tbl[2 * i];
if (((s16 *)flag)[1] < 0) ((s8 *)out3)[2 * i + 1] = -tbl[2 * i + 1]; else ((s8 *)out3)[2 * i + 1] = tbl[2 * i + 1];
}
((Pair_8013AD38 *)out2)[i] = ((Pair_8013AD38 *)out2)[0];
if (((s16 *)flag)[0] < 0) ((s8 *)out3)[2 * i] = -tbl[0]; else ((s8 *)out3)[2 * i] = tbl[0];
if (((s16 *)flag)[1] < 0) ((s8 *)out3)[2 * i + 1] = -tbl[1]; else ((s8 *)out3)[2 * i + 1] = tbl[1];
}
DEFINE_func_8013AF20() /* dedup: shared engine-core @0x8013AF20 (src/shared) */
DEFINE_func_8013B204() /* dedup: shared engine-core @0x8013B204 (src/shared) */
extern void *func_80010A08(s32);
extern s16 D_8018BCB4, D_8018BCB6, D_8018BCB8, D_8018BCBA, D_8018BCBC, D_8018BCBE;
extern u16 D_800D45F6;
void func_8013B274(s32 a0, s32 a1, void *a2)
{
u8 *p;
s32 L[10];
s16 sa;
s32 quot;
s16 ang;
p = (u8 *)func_80010A08(0x28);
p[3] = 9;
p[7] = 0x2C;
p[4] = 0x80;
p[5] = 0x80;
p[6] = 0x80;
*(s16 *)(p + 0x16) = 0x37;
*(s16 *)(p + 0xE) = 0x6FD6;
p[0xC] = 0xE0;
p[0xD] = 0;
p[0x14] = 0xEF;
p[0x15] = 0;
p[0x1C] = 0xE0;
p[0x1D] = 0xF;
p[0x24] = 0xEF;
p[0x25] = 0xF;
sa = (s16)a1;
if (sa == 0) {
*(s16 *)L = 0;
} else {
quot = ((s32)sa << 12) / ((s16*)a2)[0];
ang = (s16)quot;
if (!(D_8018BCB6 < ang)) goto outer_else;
if (!(ang < D_8018BCBC)) goto inner_else;
if (ang < D_8018BCB8) { *(s16 *)L = D_8018BCB8; goto done; }
if (D_8018BCBA < ang) { *(s16 *)L = D_8018BCBA; goto done; }
*(s16 *)L = quot;
goto done;
outer_else:
if (ang < D_8018BCB4) { *(s16 *)L = D_8018BCB4; goto done; }
*(s16 *)L = quot;
goto done;
inner_else:
if (D_8018BCBE < ang) { *(s16 *)L = D_8018BCBE; goto done; }
*(s16 *)L = quot;
done: ;
}
*(s16 *)((u8 *)L + 2) = D_800D45F6;
__asm__ __volatile__(
"lwc2 $0, 0(%0)\n"
"lwc2 $1, 4(%0)\n"
"nop\n" "nop\n"
"mvmva 1, 0, 0, 0, 0\n"
: : "r"(L) : "memory");
__asm__ __volatile__(
"swc2 $25, 0(%0)\n"
"swc2 $26, 4(%0)\n"
"swc2 $27, 8(%0)\n"
: : "r"((u8 *)L + 8) : "memory");
if (((s16*)a2)[1] > 0)
*(s32 *)((u8 *)L + 0xC) -= 1;
else
*(s32 *)((u8 *)L + 0xC) += 2;
*(s16 *)L = 9;
*(s16 *)((u8 *)L + 2) = 9;
__asm__ __volatile__(
"lwc2 $0, 0(%0)\n"
"lwc2 $1, 4(%0)\n"
"nop\n" "nop\n"
"mvmva 1, 0, 0, 3, 0\n"
: : "r"(L) : "memory");
__asm__ __volatile__(
"swc2 $25, 0(%0)\n"
"swc2 $26, 4(%0)\n"
"swc2 $27, 8(%0)\n"
: : "r"((u8 *)L + 0x18) : "memory");
*(s16 *)(p + 8) = *(volatile s32 *)((u8 *)L + 8);
*(s16 *)(p + 0xA) = *(volatile s32 *)((u8 *)L + 0xC);
*(s16 *)(p + 0x10) = *(volatile s32 *)((u8 *)L + 8) + *(volatile s32 *)((u8 *)L + 0x18);
*(s16 *)(p + 0x12) = *(volatile s32 *)((u8 *)L + 0xC);
*(s16 *)(p + 0x18) = *(volatile s32 *)((u8 *)L + 8);
*(s16 *)(p + 0x1A) = *(volatile s32 *)((u8 *)L + 0xC) + *(volatile s32 *)((u8 *)L + 0x1C);
*(s16 *)(p + 0x20) = *(volatile s32 *)((u8 *)L + 8) + *(volatile s32 *)((u8 *)L + 0x18);
*(s16 *)(p + 0x22) = *(volatile s32 *)((u8 *)L + 0xC) + *(volatile s32 *)((u8 *)L + 0x1C);
((P_TAG *)p)->addr = ((P_TAG *)a0)->addr;
((P_TAG *)a0)->addr = (u32)p;
}
-752
View File
@@ -1,752 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_8013C98C() /* dedup: shared engine-core @0x8013C98C (src/shared) */
extern M2C_UNK D_80062BC0;
extern s32 D_801E95E8;
extern s8 D_801E95EC;
extern s8 D_801E95ED;
void func_8013C9C4(void * arg0)
{
D_801E95E8 = arg0;
D_801E95EC = 0;
D_801E95ED = 0;
if (func_80019198() == 0) {
func_80019064(&D_80062BC0);
}
}
extern s32 D_801E95E8;
extern s8 D_801E95EC;
extern s8 D_801E95ED;
extern s32 D_801269C8;
extern s32 D_801269D4;
void func_8013CA14(void)
{
int *base = &D_801E95E8;
signed char *p;
unsigned char c;
int t;
if ((*base) != 0)
{
c = D_801E95ED;
if (c == 0)
{
p = (signed char *) ((((unsigned int) ((unsigned char) D_801E95EC)) * 2) + D_801E95E8);
t = (int) (*p);
D_801269D4 = t;
D_801269C8 = t;
D_801E95ED = (unsigned char) p[1];
D_801E95EC = D_801E95EC + 1;
if (D_801E95ED == 0)
{
D_801269D4 = 0;
D_801269C8 = 0;
D_801E95EC = 0;
*base = 0;
}
}
else
{
D_801E95ED = c - 1;
}
}
return;
}
DEFINE_func_8013CABC() /* dedup: shared engine-core @0x8013CABC (src/shared) */
DEFINE_func_8013CAE8() /* dedup: shared engine-core @0x8013CAE8 (src/shared) */
DEFINE_func_8013CB20() /* dedup: shared engine-core @0x8013CB20 (src/shared) */
DEFINE_func_8013CB5C() /* dedup: shared engine-core @0x8013CB5C (src/shared) */
DEFINE_func_8013CB84() /* dedup: shared engine-core @0x8013CB84 (src/shared) */
// @class: struct
// @stuck: none — MATCH (63 ins)
//
// Sets up 3 consecutive 16-byte records (at D_800A5E88[0..2]: {s32 a,b,c; u8 d,e,f,g})
// and registers each via func_80028620(i, &rec[i]).
//
// Keys to the byte match:
// (1) The base pointer is anchored at D_800A5E94 (= &rec0.d, i.e. rec0+0xC) and materialized
// via a NON-volatile inline-asm `la` so gcc treats it as OPAQUE (not a const symbol).
// Opacity is what makes the base-relative stores FOLD into `off($s0)` instead of
// const-folding to a direct `lui $at; sw %lo(sym)`. A `__asm__ __volatile__` re-tie
// barrier (cookbook §21) also launders base, but the barrier pins the schedule and
// pushes the first call's `a0=0` down; the non-volatile `la` avoids the barrier so the
// scheduler still hoists `addu $a0,$zero,$zero` to the top (matches target idx1).
// (2) rec0's inner fields (E8C/E90 ints, E95/E96 bytes) are written as DIRECT globals, not
// base-relative — in the entry block gcc emits them as `lui $at; sw/sb %lo(sym)`. Only
// the address-taken E88 (= call arg base-0xC) and the offset-0 E94 fold via $s0. rec1/rec2
// fold entirely (base opaque, all offsets small).
// (3) The three source bytes per record are loaded into temps t0/t1/t2 BEFORE the stores so
// gcc keeps them live in three registers ($v1/$a2/$a3) as a group (not one-at-a-time in $v0).
// (4) Statement order matches the target scheduler: rec1 stores b(=7) before the loads;
// rec2 stores b(=-0x12) AFTER the loads (the differing constants drive the scheduler).
#include "common.h"
void func_8013CF68()
{
extern void func_80028620();
extern u8 D_800A5E94[];
extern s32 D_800A5E8C;
extern s32 D_800A5E90;
extern u8 D_800A5E95;
extern u8 D_800A5E96;
extern u8 D_801EAEE8;
extern u8 D_801EAEE9;
extern u8 D_801EAEEA;
extern u8 D_801EAEEB;
extern u8 D_801EAEEC;
extern u8 D_801EAEED;
extern u8 D_801EAEEE;
extern u8 D_801EAEEF;
extern u8 D_801EAEF0;
u8 t0, t1, t2;
u8 *base;
__asm__("la %0, D_800A5E94" : "=r"(base));
*(s32 *)(base - 0xC) = 0;
t0 = D_801EAEE8; t1 = D_801EAEE9; t2 = D_801EAEEA;
D_800A5E8C = 0x1E;
D_800A5E90 = 0;
base[0] = t0; D_800A5E95 = t1; D_800A5E96 = t2;
func_80028620(0, base - 0xC);
*(s32 *)(base + 4) = 0; *(s32 *)(base + 8) = 7;
t0 = D_801EAEEB; t1 = D_801EAEEC; t2 = D_801EAEED;
*(s32 *)(base + 0xC) = 0x14;
base[0x10] = t0; base[0x11] = t1; base[0x12] = t2;
func_80028620(1, base + 4);
*(s32 *)(base + 0x14) = 0;
t0 = D_801EAEEE; t1 = D_801EAEEF; t2 = D_801EAEF0;
*(s32 *)(base + 0x18) = -0x12;
*(s32 *)(base + 0x1C) = 0;
base[0x20] = t0; base[0x21] = t1; base[0x22] = t2;
func_80028620(2, base + 0x14);
}
// @class: schedule
// @stuck: testing if/else-if with ==2 placed as the else (tail) block
extern s32 D_801E9618;
extern s32 D_801E9600;
extern s32 D_801E961C;
extern s32 D_801E960C;
extern void func_8013D9B0();
void func_8013D064(void)
{
if (D_801E9618 != 0) {
if (D_801E9618 != 2) {
if (((D_801E9618 < 3) && (D_801E9618 == 1)) &&
(D_801E961C = D_801E961C + 1, 0x23a < D_801E961C)) {
D_801E9600 = D_801E9618;
D_801E9618 = 2;
}
} else {
D_801E9600 = D_801E9600 + -1;
if (D_801E9600 == 0) {
D_801E9600 = D_801E9618;
((void (*)(s32))func_8013D9B0)(2);
if (D_801E960C == 0) {
D_801E9618 = D_801E9618 + 1;
}
}
}
}
return;
}
DEFINE_func_8013D13C() /* dedup: shared engine-core @0x8013D13C (src/shared) */
DEFINE_func_8013D164() /* dedup: shared engine-core @0x8013D164 (src/shared) */
DEFINE_func_8013D178() /* dedup: shared engine-core @0x8013D178 (src/shared) */
// @class: other
// @stuck: none — MATCH (three step-toward-target byte clamps + word store)
extern u8 D_801EAFCA;
extern u8 D_801EB03E;
extern u8 D_801EAEF2;
extern u8 D_801EAFAC;
extern u8 D_801EAED0;
extern u8 D_801EAEF1;
extern s32 D_801EAFB0;
void func_8013D330(void) {
if ((D_801EAFCA & 0xff) != D_801EB03E) {
D_801EAFCA = ((D_801EAFCA & 0xff) < D_801EB03E) ? (D_801EAFCA + 1) : (D_801EAFCA - 1);
}
if ((D_801EAEF2 & 0xff) != D_801EAFAC) {
D_801EAEF2 = ((D_801EAEF2 & 0xff) < D_801EAFAC) ? (D_801EAEF2 + 1) : (D_801EAEF2 - 1);
}
if ((D_801EAED0 & 0xff) != D_801EAEF1) {
D_801EAED0 = ((D_801EAED0 & 0xff) < D_801EAEF1) ? (D_801EAED0 + 1) : (D_801EAED0 - 1);
}
D_801EAFB0 = 1;
}
// @class: regalloc-order
// @stuck: none — MATCH (match_one 90/90); base &D_80078E78 cached in a pointer local so gcc pins it into callee-saved $s1 and hoists the addr to the prologue (live across all 4 calls); direct array access D_80078E78[0x37] instead folds %lo per use (no $s1, frame 0x18 not 0x20)
DEFINE_func_8013D3D4() /* dedup: shared engine-core @0x8013D3D4 (src/shared) */
/* 9-byte, align-1 -> unaligned block copy */
DEFINE_func_8013D53C() /* dedup: shared engine-core @0x8013D53C (src/shared) */
extern void func_800599B8(u16*);
void func_8013D8FC(void)
{
extern s16 *D_801E95FC;
register s16 *psVar3 __asm__("$17");
register s16 *psVar2 __asm__("$16");
register s32 c9 __asm__("$19");
register s32 cff __asm__("$18");
u16 sVar1;
s16 buf[4];
psVar3 = D_801E95FC;
if (psVar3 != (s16 *)0x0 && (sVar1 = (u16)*psVar3, sVar1 != 0xff)) {
c9 = 9;
cff = 0xff;
psVar2 = psVar3 + 5;
do {
if (sVar1 == c9) {
s32 arg2 = *(s32 *)(psVar2 + 1) + psVar2[-1] * 2;
buf[0] = psVar2[-3];
buf[1] = psVar2[-2];
buf[2] = psVar2[-1];
buf[3] = *psVar2;
((void (*)(s32, s32))func_800599B8)((s32)buf, arg2);
}
psVar3 = psVar3 + 8;
sVar1 = (u16)*psVar3;
psVar2 = psVar2 + 8;
} while (sVar1 != cff);
}
}
extern void *D_801E95F4;
extern s32 D_801E960C;
extern void func_800599B8(u16*);
#define gte_ldIR0z() __asm__ __volatile__("mtc2 $0, $8")
#define gte_ldrgb(p) __asm__ __volatile__("lwc2 $6, 0(%0)" :: "r"(p) : "memory")
#define gte_ldIRGB(p) __asm__ __volatile__("lwc2 $28, 0(%0)" :: "r"(p) : "memory")
#define gte_dpcl() __asm__ __volatile__("nop\n\tnop\n\tdpcl")
#define gte_stORGB(p) __asm__ __volatile__("swc2 $29, 0(%0)" :: "r"(p) : "memory")
void func_8013D9B0(int param_1)
{
extern s16 *D_801E95FC;
extern s32 D_801E9614;
u8 buf[0x20];
register s32 uVar13 __asm__("$16");
register u16 *psVar14 __asm__("$17");
register u16 *psVar15 __asm__("$18");
register s32 uVar16 __asm__("$19");
register void *r0 __asm__("$20");
register u16 *puVar10 __asm__("$11");
register u16 *puVar9 __asm__("$10");
register s32 iVar11 __asm__("$13");
register s32 iVar12 __asm__("$14");
u16 sVar4;
register u32 uVar5 __asm__("$3");
register u32 uVar7 __asm__("$6");
register u32 uVar1 __asm__("$7");
register u32 uVar6 __asm__("$4");
register u32 uVar8 __asm__("$8");
register u32 uVar3 __asm__("$9");
psVar15 = (*(u16 * *)&D_801E95FC);
if (psVar15 != 0) {
sVar4 = *psVar15;
*(u32 *)(buf + 8) = (*(u32 * *)&D_801E95F4)[param_1];
D_801E9614 = -1;
uVar16 = 0;
if (sVar4 != 0xff) {
r0 = buf + 8;
psVar14 = psVar15 + 6;
do {
iVar11 = 0;
if (sVar4 == 9) {
*(s16 *)(buf + 0) = psVar14[-4];
__asm__ __volatile__("" ::: "memory");
*(s16 *)(buf + 2) = psVar14[-3];
__asm__ __volatile__("" ::: "memory");
*(s16 *)(buf + 4) = psVar14[-2];
__asm__ __volatile__("" ::: "memory");
*(s16 *)(buf + 6) = psVar14[-1];
__asm__ __volatile__("" ::: "memory");
{
register s32 mw __asm__("$3") = (s32)((s16 *)psVar14)[-2];
register s32 mh __asm__("$2") = (s32)((s16 *)psVar14)[-1];
iVar12 = mw * mh;
}
uVar13 = 0;
puVar10 = *(u16 **)psVar14;
{
register s32 boff __asm__("$2") = iVar12 * 2;
register u16 *pi __asm__("$5");
pi = (u16 *)((s32)puVar10 + boff);
__asm__ __volatile__("" : "=r"(pi) : "0"(pi));
puVar9 = pi;
}
if (0 < iVar12) {
do {
register u32 pix __asm__("$2");
register u32 out __asm__("$2");
u32 result;
*(u32 *)(buf + 0xc) = (u32)*puVar10;
pix = (u32)*puVar9;
uVar5 = pix & 0x1f;
uVar7 = pix & 0x3e0;
uVar1 = pix & 0x7c00;
{
void *p1;
register void *pa __asm__("$2");
register void *pb __asm__("$12");
__asm__ __volatile__("");
p1 = buf + 0xc;
__asm__ __volatile__("" : "=r"(p1) : "0"(p1));
gte_ldIR0z();
gte_ldrgb(r0);
gte_ldIRGB(p1);
gte_dpcl();
pa = buf + 0x10;
__asm__ __volatile__("" : "=r"(pa) : "0"(pa));
pb = pa;
gte_stORGB(pb);
}
out = *(u32 *)(buf + 0x10);
uVar6 = out & 0x1f;
uVar8 = out & 0x3e0;
uVar3 = out & 0x7c00;
if (uVar5 != uVar6) {
register s32 c __asm__("$2");
uVar13 = 1;
if ((s32)uVar5 < (s32)uVar6) uVar5 = uVar5 + 1;
c = (s32)uVar6 < (s32)uVar5;
if (c) uVar5 = uVar5 - 1;
}
if (uVar7 != uVar8) {
register s32 c __asm__("$2");
uVar13 = 1;
if ((s32)uVar7 < (s32)uVar8) uVar7 = uVar7 + 0x20;
c = (s32)uVar8 < (s32)uVar7;
if (c) uVar7 = uVar7 - 0x20;
}
if (uVar1 != uVar3) {
register s32 c __asm__("$2");
uVar13 = 1;
if ((s32)uVar1 < (s32)uVar3) uVar1 = uVar1 + 0x400;
c = (s32)uVar3 < (s32)uVar1;
if (c) uVar1 = uVar1 - 0x400;
}
result = uVar5 | uVar7 | uVar1 | (*(u32 *)(buf + 0xc) & 0x8000);
if (result == 0 && *(u32 *)(buf + 0xc) != 0) {
result = 0x8000;
}
*puVar9 = (u16)result;
puVar9 = puVar9 + 1;
iVar11 = iVar11 + 1;
puVar10 = puVar10 + 1;
} while (iVar11 < iVar12);
}
if (uVar13 != 0) {
((void (*)(void *))func_800599B8)(buf);
}
uVar16 = uVar16 | uVar13;
}
psVar15 = psVar15 + 8;
sVar4 = *psVar15;
psVar14 = psVar14 + 8;
} while (sVar4 != 0xff);
}
D_801E960C = uVar16;
}
return;
}
// @class: struct
// @stuck: none — MATCH (match_one 97/97). Two levers: (1) offset-first pointer arith
// `(int*)(param_1*12 + (int)D_801E95F8)` makes the addu `offset+base` (dest=v0) so x/y/z
// load into a0/a1/a2 and each global loads LATE into v1 (base-first gave addu dest=v1 →
// global hoisted into a0, shifting x/y/z to a1/a2/a3). (2) the clamp must be NESTED
// if/else (slti dup'd inside each <,>= branch), NOT a merged `if(diff<5)` after the
// branch — gcc cross-jumps the identical `G=x` and `G=t` store tails into the two shared
// sites; the merged form emits one slti + unconditional store and diverges.
DEFINE_func_8013DBE4() /* dedup: shared engine-core @0x8013DBE4 (src/shared) */
// @class: regalloc-order
// @stuck: none — MATCH (187 ins). Levers: struct-assign DRAWENV copy (align via type); pbase local for $s2-relative D_800B9A02; two-biv SPRT loop (q anchored one-above -> gcc re-anchors, no bare-deref); P_TAG_8013DD68 addPrim; single p var coalesces puVar7->puVar15; pins uVar2=$v1,iVar14=$a3,c5=$t3; biv-increment order sets q-init-before-puVar10-init; Buf_8013DD68 0x68 -> frame 0xA0.
/* 0x5C copy unit, align 4 */
/* -> frame 0xA0 (gcc adds 0x10 for the struct-copy) */
#define IDVAL (*(u16 *)(pbase + 0xA3D2))
#define OTE ((P_TAG_8013DD68 *)(D_800BA0E4 + IDVAL * 0x10))
void func_8013DD68() {
extern void SetDrawEnv(void *p, void *env);
extern u16 D_800AF7B8;
extern u8 D_800BA0E4[];
extern u8 D_8018BF10[];
u32 *p;
u16 uVar1;
u16 *puVar16;
u16 *q;
u16 *puVar10;
register u16 uVar2 __asm__("$3");
int uVar5;
register int iVar14 __asm__("$7");
Buf_8013DD68 buf;
u8 *pbase;
u8 *base;
pbase = D_800AF630;
puVar16 = (*(u16 * *)&D_801E95FC);
p = (*(u32 * *)&D_800A5E60);
uVar1 = *puVar16;
puVar16 = puVar16 + 1;
base = pbase + (u32)D_800AF7B8 * 0x5C;
buf.env = *(DrawEnv_8013DD68 *)(base + 0x38);
*((u8 *)&buf + 0x18) = 0;
SetDrawEnv(p, &buf);
((P_TAG_8013DD68 *)p)->addr = OTE->addr;
OTE->addr = (u32)p;
p = p + 0x10;
iVar14 = 0;
if (uVar1 != 0) {
register int c5 __asm__("$11") = 5;
puVar10 = (u16 *)((int)p + 0x18);
q = puVar16 + 8;
do {
*(u8 *)((int)puVar10 + -0x15) = c5;
uVar2 = q[-6];
*(u8 *)((int)puVar10 + -0xd) = 100;
*(u8 *)((int)puVar10 + -0x10) = (u8)(*(int*)&D_801E962C);
*(u8 *)((int)puVar10 + -0xf) = (u8)(*(int*)&D_801E9630);
uVar5 = (*(int*)&D_801E9634);
*(u32 *)((int)puVar10 + -0x14) = uVar2 & 0x9ff | 0xe1000400;
*(u8 *)((int)puVar10 + -0xe) = (u8)uVar5;
*(u16 *)((int)puVar10 + -0xc) = q[-4];
iVar14 = iVar14 + 1;
*(u16 *)((int)puVar10 + -0xa) = q[-3];
*(u8 *)((int)puVar10 + -8) = (u8)*puVar16;
uVar2 = q[-7];
*(u16 *)((int)puVar10 + -6) = 0x7800;
*(u8 *)((int)puVar10 + -7) = (u8)uVar2;
puVar16 = puVar16 + 8;
*(u16 *)((int)puVar10 + -4) = q[-2];
*(u16 *)((int)puVar10 + -2) = q[-1];
((P_TAG_8013DD68 *)p)->addr = OTE->addr;
puVar10 = puVar10 + 0xc;
OTE->addr = (u32)p;
p = p + 6;
q = q + 8;
} while (iVar14 < (int)(u32)uVar1);
}
SetDrawEnv(p, D_8018BF10);
((P_TAG_8013DD68 *)p)->addr = OTE->addr;
OTE->addr = (u32)p;
p = p + 0x10;
(*(u32 * *)&D_800A5E60) = p;
return;
}
DEFINE_func_8013E054() /* dedup: shared engine-core @0x8013E054 (src/shared) */
DEFINE_func_8013E064() /* dedup: shared engine-core @0x8013E064 (src/shared) */
DEFINE_func_8013E0FC() /* dedup: shared engine-core @0x8013E0FC (src/shared) */
DEFINE_func_8013E194() /* dedup: shared engine-core @0x8013E194 (src/shared) */
DEFINE_func_8013E22C() /* dedup: shared engine-core @0x8013E22C (src/shared) */
DEFINE_func_8013E298() /* dedup: shared engine-core @0x8013E298 (src/shared) */
DEFINE_func_8013E2C4() /* dedup: shared engine-core @0x8013E2C4 (src/shared) */
DEFINE_func_8013E370() /* dedup: shared engine-core @0x8013E370 (src/shared) */
DEFINE_func_8013E410() /* dedup: shared engine-core @0x8013E410 (src/shared) */
DEFINE_func_8013E448() /* dedup: shared engine-core @0x8013E448 (src/shared) */
DEFINE_func_8013E4B4() /* dedup: shared engine-core @0x8013E4B4 (src/shared) */
DEFINE_func_8013E558() /* dedup: shared engine-core @0x8013E558 (src/shared) */
DEFINE_func_8013E588() /* dedup: shared engine-core @0x8013E588 (src/shared) */
extern void func_80029444(void);
extern void func_801754A8(void);
extern s32 func_80014ED4(s32);
extern s32 func_80015018(s32);
extern void func_800190AC(void);
extern void func_80141C04(void);
void func_8013E5E8(void)
{
extern u16 D_8011511E;
extern u16 D_8011511C;
extern unsigned short D_80115112;
extern u16 D_80115116;
extern void (*D_8018C920[])(void);
register void (*fp)(void) __asm__("$2"); /* pin fn-ptr to $v0 -> store retires early */
func_80029444();
func_801754A8();
D_8011511E = func_80014ED4(0);
D_8011511C = func_80015018(0);
fp = D_8018C920[D_80115112];
fp();
func_800190AC();
func_80141C04();
D_80115116 += 1;
}
DEFINE_func_8013E67C() /* dedup: shared engine-core @0x8013E67C (src/shared) */
// @class: regalloc-order
// @stuck: none — MATCH (90 ins, relocation-masked)
DEFINE_func_8013E6AC() /* dedup: shared engine-core @0x8013E6AC (src/shared) */
DEFINE_func_8013E814() /* dedup: shared engine-core @0x8013E814 (src/shared) */
// @class: plumbing
// @stuck: none — MATCH (direct u16 global reads fold to lui/lhu; scheduler hoists the D_8011511A read above the prologue, reproduced by -O2)
void func_8013E83C() {
extern void func_80141C0C(int);
extern unsigned short D_80115118;
extern unsigned short D_80115128;
extern unsigned short D_8011512E;
extern unsigned int D_80115130;
extern unsigned short D_80115158;
extern unsigned short D_8011515A;
extern unsigned short D_8011515C;
extern unsigned short D_8011515E;
extern unsigned short D_80115162;
extern unsigned short D_80115166;
extern void * D_801E9648;
extern void * D_801E964C;
extern unsigned char D_8018C584;
extern unsigned char D_8018C59C;
extern unsigned char D_8018C610;
extern unsigned char D_8018C618;
D_80115118 = 0;
D_80115130 = 0;
if (D_8011511A >= 4) {
D_8011511A = D_8011511A - 3;
}
D_80115158 = 0x106;
if ((((int(*)(int))func_80029178)(0x1c) & 0xFF) == 0) {
D_801E9648 = &D_8018C584;
D_801E964C = &D_8018C610;
} else {
D_801E9648 = &D_8018C59C;
D_801E964C = &D_8018C618;
}
D_8011515A = 0x104;
D_8011515C = 0x104;
D_8011515E = 0x129;
D_80115162 = 0x103;
D_80115166 = 0x105;
D_80115128 = 0;
D_8011512E = 0;
if (D_80115110 == 3) {
((void(*)(int, int))func_8002D4C8)(0x46e, 0);
} else {
func_80141C0C(0);
}
}
// @class: schedule
// @stuck: none — MATCH (63 ins). The idx-32+ residual was a THIRD held base pointer for the
// D_80115188 store: the draft's `((Cell*)&D_80115188)[i].v = v` allocates a pointer, so gcc kept
// three bases (D_80115110/D_8018C90C/D_80115188) and buried the branch-delay `sll` (i<<16 carry)
// under the extra store. Switching to the sibling func_8013E6AC's relocation-masked form
// `*(s32*)((char*)&D_80115188 + (i<<2))` recomputes that address via per-iteration %hi/%lo, leaving
// only TWO held pointers (fp=&D_80115110 -> $t0, ep=&D_8018C90C -> $a3) and freeing the delay slot
// to carry `i<<16` in $a0 exactly as the target does. Head (idx 0-31) already matched; i naturally
// lands in $a2 from the goto-loop delay slots, driving the fp/ep/fa=$8/$7/$5 alloc with no pins.
void func_8013E958()
{
extern void func_8014AA28(void);
extern s32 func_800D0488(s32);
extern void func_80141C0C(s32);
s16 *p = &(*(s16*)&D_80115124);
s16 i;
s32 v;
s16 m;
D_800B9A15 = 0;
func_80139954();
if (D_80078EC0 != *p) {
func_8014AA28();
if ((D_80078EC0 & 0x7F) != 0) {
m = D_80078EC0 & 0x7F;
*p = m;
if (m == 0 || func_800D0488(m) == 0)
goto loop;
}
}
*p = 0;
loop:
for (i = 0; i < 5; i++) {
s32 *q = &((s32 *)&D_80115110)[i];
v = ((s32 *)&D_8018C90C)[i] >> 6;
q[0x16] = v;
*(s32 *)((char *)&D_80115188 + (i << 2)) = v;
}
func_80141C0C(7);
(*(u16*)&D_80115112) = 4;
}
DEFINE_func_8013EA54() /* dedup: shared engine-core @0x8013EA54 (src/shared) */
// @class: regalloc-order
// @stuck: none — MATCH (sVar2 pinned to $v0 forces in-place sll/sra sign-ext scratch)
DEFINE_func_8013EB7C() /* dedup: shared engine-core @0x8013EB7C (src/shared) */
DEFINE_func_8013ED6C() /* dedup: shared engine-core @0x8013ED6C (src/shared) */
DEFINE_func_8013EE10() /* dedup: shared engine-core @0x8013EE10 (src/shared) */
DEFINE_func_8013EF88() /* dedup: shared engine-core @0x8013EF88 (src/shared) */
// @class: struct
// @stuck: none — MATCH expected (u16* base materialization for read+write, %lo-folded single-access globals)
extern unsigned short D_80115118;
extern unsigned short D_80115112;
extern u16 D_80115110;
extern unsigned char D_8018C8E8;
extern unsigned char *func_80141CA4(void);
extern void func_801376E8(int a0, int a1);
void func_8013F138(void) {
u16 *p = &D_80115118;
*p += 0x10;
if ((u16)*p >= 0x40) {
if (D_80115110 == 0) {
((void (*)(int, unsigned char *))func_801376E8)((int)func_80141CA4(), &D_8018C8E8);
}
D_80115112 += 1;
}
}
DEFINE_func_8013F1BC() /* dedup: shared engine-core @0x8013F1BC (src/shared) */
DEFINE_func_8013F244() /* dedup: shared engine-core @0x8013F244 (src/shared) */
-33
View File
@@ -1,33 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
/* 0x5C copy unit, align 4 */
/* -> frame 0xA0 (gcc adds 0x10 for the struct-copy) */
DEFINE_func_8013F350() /* dedup: shared engine-core @0x8013F350 (src/shared) */
// @class: regalloc-order
// @stuck: none — MATCH (312/312, relocation-masked)
DEFINE_func_8013FAF8() /* dedup: shared engine-core @0x8013FAF8 (src/shared) */
-17
View File
@@ -1,17 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
/* 0x5C copy unit, align 4 */
/* -> frame 0xA0 (gcc adds 0x10 for the struct-copy) */
DEFINE_func_8013FFD8() /* dedup: shared engine-core @0x8013FFD8 (src/shared) */
DEFINE_func_8014032C() /* dedup: shared engine-core @0x8014032C (src/shared) */
File diff suppressed because it is too large Load Diff
-102
View File
@@ -1,102 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_8015444C() /* dedup: shared engine-core @0x8015444C (src/shared) */
/*
* func_801549F8 — scan param->b4[] (s32[], length = the u8 at param->bc),
* stepping the index by 1 or 2 per entry via the 27-entry jump table
* jtbl_801D89A4; count the default/out-of-range entries. Returns (u8) count.
*
* REDRAFT NOTE (the decay fix, 2 levers — both required, both source-level):
*
* 1. `u8 n` (NOT `s32 n`) — THE fix for the stored draft's 3-off residual.
* The stored draft's whole residual was the position of the loop-bound
* keep-alive copy `addu $a3,$v0,$zero` among the three preheader insns:
* draft emitted [lw base][copy][lui/addiu jtbl], target wants
* [lw base][lui/addiu jtbl][copy]. The loop-invariant jtbl address is
* moved by loop.c and lands AFTER every preheader source statement, so as
* long as the copy is an ordinary preheader statement it can never follow
* the hoist. Making `n` a u8 changes the RTL for `n = *(u8*)(p+0xBC)`:
* cse1 no longer converts it into a plain reg-reg copy in place, and the
* copy that ultimately feeds the exit test is emitted at loop_start AFTER
* move_movables (post-loop pass), i.e. after the hoisted lui/addiu — the
* target order. Nothing else in the function changes.
*
* 2. The `j = i` / `i = j + k` index form BLOCKS strength reduction, which
* is what the stored draft's `register s32 i __asm__("$3")` pin was for.
* Unblocked, -O2 turns base[i] into a walking pointer (2nd biv, 33 ins);
* the target keeps the INDEX form (sll $v0,$v1,2; addu $v0,$v0,$a0; lw).
* `j` is a mult=1/add=0 giv of the biv `i`, so SR declines and i/j get
* coalesced into $v1 — no extra insn. This replaces the hard-register
* pin, so the match is pin-free and safe to travel to sibling overlays.
* (The pinned form — keep `register s32 i __asm__("$3")` + `i += 1/2` and
* just change `n` to u8 — also MATCHes, 31 ins, if a pin is ever wanted.)
*
* OPT LEVEL: plain -O2. The unfilled load-delay nops are this psx gcc's
* default, not an -O1 tell.
*
* VERIFIED: python3 tools/match_one.py func_801549F8 --c .run/uc/func_801549F8.c
* --asm-subdir asm/ov_SC01_077/nonmatchings/ov_SC01_077_jr_8015444C
* -> MATCH (31 ins)
*/
s32 func_801549F8(s32 param_1, s32 _arg1, s32 _arg2)
{
s32 i, j;
u8 n;
u8 count;
s32 *base;
count = 0;
i = 0;
if (*(u8 *)(param_1 + 0xBC) != 0) {
base = *(s32 **)(param_1 + 0xB4);
n = *(u8 *)(param_1 + 0xBC);
do {
j = i;
switch (base[j]) {
case 0: case 2: case 7: case 8: case 9: case 10:
case 0xd: case 0x10: case 0x11: case 0x12: case 0x13:
case 0x14: case 0x19: case 0x1a:
i = j + 1;
break;
case 3: case 4: case 5: case 6: case 0xb: case 0xc:
case 0xe: case 0xf: case 0x15: case 0x16:
i = j + 2;
break;
default:
i = j + 1;
count += 1;
break;
}
} while (i != n);
}
return count;
}
DEFINE_func_80154A74() /* dedup: shared engine-core @0x80154A74 (src/shared) */
DEFINE_func_80154AB4() /* dedup: shared engine-core @0x80154AB4 (src/shared) */
DEFINE_func_80154AE0() /* dedup: shared engine-core @0x80154AE0 (src/shared) */
DEFINE_func_80154B20() /* dedup: shared engine-core @0x80154B20 (src/shared) */
DEFINE_func_80154B4C() /* dedup: shared engine-core @0x80154B4C (src/shared) */
DEFINE_func_80154B7C() /* dedup: shared engine-core @0x80154B7C (src/shared) */
DEFINE_func_80154B98() /* dedup: shared engine-core @0x80154B98 (src/shared) */
DEFINE_func_80154BC8() /* dedup: shared engine-core @0x80154BC8 (src/shared) */
DEFINE_func_80154BE4() /* dedup: shared engine-core @0x80154BE4 (src/shared) */
-796
View File
@@ -1,796 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_80154C24() /* dedup: shared engine-core @0x80154C24 (src/shared) */
DEFINE_func_80154ED8() /* dedup: shared engine-core @0x80154ED8 (src/shared) */
DEFINE_func_80154F9C() /* dedup: shared engine-core @0x80154F9C (src/shared) */
// @class: struct
// @stuck: none — MATCH (array-of-struct stride-8 base materialize + addu, %lo folded into addiu)
extern void MoveImage(void *a0, s32 a1, s32 a2);
extern void func_800183E0(s32 a0);
extern ImgRect8 D_8018D398[];
void func_801550FC(s32 arg0)
{
if (arg0 & 0x40000000) {
MoveImage(&D_8018D398[arg0 & 0xFF], 0x200, 0x100);
} else {
((void (*)(void))func_800183E0)();
}
}
DEFINE_func_80155150() /* dedup: shared engine-core @0x80155150 (src/shared) */
DEFINE_func_801552F4() /* dedup: shared engine-core @0x801552F4 (src/shared) */
DEFINE_func_80155344() /* dedup: shared engine-core @0x80155344 (src/shared) */
DEFINE_func_80155394() /* dedup: shared engine-core @0x80155394 (src/shared) */
DEFINE_func_801553A8() /* dedup: shared engine-core @0x801553A8 (src/shared) */
DEFINE_func_801553C0() /* dedup: shared engine-core @0x801553C0 (src/shared) */
DEFINE_func_80155440() /* dedup: shared engine-core @0x80155440 (src/shared) */
// @class: struct
// @stuck: none — MATCH expected; decrement persists as separate addiu in delay slot
extern int (*D_8018D3D8[])(void);
s32 func_80155458(s32 param_1)
{
int idx;
idx = *(unsigned char *)(param_1 + 0x4e);
if (idx != 0) {
idx = idx - 1;
if ((*D_8018D3D8[idx])() == 0) {
*(unsigned char *)(param_1 + 0x4e) = 0;
}
}
return *(unsigned char *)(param_1 + 0x4e);
}
DEFINE_func_801554B8() /* dedup: shared engine-core @0x801554B8 (src/shared) */
DEFINE_func_80155518() /* dedup: shared engine-core @0x80155518 (src/shared) */
DEFINE_func_8015554C() /* dedup: shared engine-core @0x8015554C (src/shared) */
DEFINE_func_80155580() /* dedup: shared engine-core @0x80155580 (src/shared) */
DEFINE_func_801555BC() /* dedup: shared engine-core @0x801555BC (src/shared) */
void func_801555F4(void *param_1)
{
extern void func_80156648(int *a0);
extern int D_800D4C94;
extern int D_800D4CE4;
extern int D_800D4D38;
extern int D_800D4D88;
extern int D_800D4E10;
extern int D_800D4E6C;
int uVar1;
unsigned char bVar3;
int s1;
unsigned short uVar4;
((void(*)(int, int))func_80154A74)(((int)param_1), 0x15);
if ((*(unsigned int *)(((int)param_1) + 0x44) & 0x200) == 0) {
if (*(int *)(((int)param_1) + 0x2c) == -0xb0000) {
uVar1 = ((int(*)(int))func_80029178)(0x82);
if ((uVar1 & 0xff) != 0) {
uVar1 = 7;
goto L_648;
}
}
} else {
uVar1 = 5;
L_648:
*(unsigned char *)(((int)param_1) + 0x1aa) = uVar1;
}
switch (*(unsigned char *)(((int)param_1) + 0x1aa)) {
case 0:
case 1:
bVar3 = *(unsigned char *)(((int)param_1) + 0x1ab) ^ 1;
*(unsigned char *)(((int)param_1) + 0x1ab) = bVar3;
if (bVar3 != 0)
*(unsigned char *)(((int)param_1) + 0x1aa) = 0;
else
*(unsigned char *)(((int)param_1) + 0x1aa) = 1;
((void(*)(int *, int))func_80154274)((int *)((int)param_1), (int)&D_800D4C94);
((void(*)(int))func_80147324)(0x400);
((void(*)(unsigned short))func_80147300)(0x5f3);
s1 = 0;
D_8011F730 |= 3;
func_80146CA0((void *)((int)param_1));
goto L_7b8;
case 2:
((void(*)(int *, int))func_80154274)((int *)((int)param_1), (int)&D_800D4CE4);
((void(*)(int))func_80147324)(0x446);
((void(*)(unsigned short))func_80147300)(0x5f3);
s1 = 1;
goto L_575c;
case 3:
((void(*)(int *, int))func_80154274)((int *)((int)param_1), (int)&D_800D4D38);
((void(*)(int))func_80147324)(0x400);
((void(*)(unsigned short))func_80147300)(0x5f3);
s1 = 2;
goto L_575c;
case 4:
((void(*)(int *, int))func_80154274)((int *)((int)param_1), (int)&D_800D4D88);
((void(*)(unsigned short))func_80147300)(0x5f6);
s1 = 3;
func_80146CA0((void *)((int)param_1));
L_575c:
func_80146CA0((void *)((int)param_1));
goto L_7b8;
case 5:
((void(*)(int *, int))func_80154274)((int *)((int)param_1), (int)&D_800D4E10);
s1 = 4;
uVar4 = 7;
goto L_7b0;
case 7:
((void(*)(int))func_80147324)(0x7f);
((void(*)(unsigned short))func_80147300)(0x5f4);
((void(*)(int *, int))func_80154274)((int *)((int)param_1), (int)&D_800D4E6C);
s1 = 6;
uVar4 = 8;
L_7b0:
*(unsigned short *)(((int)param_1) + 2) = uVar4;
goto L_7b8;
default:
;
}
L_7b8:
((void(*)(int *, int))func_80146E90)((int *)((int)param_1), 0);
func_80156648((int *)((int)param_1));
if (s1 >= 0) {
((int(*)(int, int, int, int))func_80146994)(4, ((int)param_1), s1, 0);
}
((void(*)(int *))func_801553A8)((int *)((int)param_1));
}
#include "common.h"
DEFINE_func_80155800() /* dedup: shared engine-core @0x80155800 (src/shared) */
DEFINE_func_80155A44() /* dedup: shared engine-core @0x80155A44 (src/shared) */
DEFINE_func_80155B20() /* dedup: shared engine-core @0x80155B20 (src/shared) */
DEFINE_func_80155B9C() /* dedup: shared engine-core @0x80155B9C (src/shared) */
DEFINE_func_80155C0C() /* dedup: shared engine-core @0x80155C0C (src/shared) */
DEFINE_func_80155C64() /* dedup: shared engine-core @0x80155C64 (src/shared) */
DEFINE_func_80155D70() /* dedup: shared engine-core @0x80155D70 (src/shared) */
DEFINE_func_80155E30() /* dedup: shared engine-core @0x80155E30 (src/shared) */
DEFINE_func_80155EA4() /* dedup: shared engine-core @0x80155EA4 (src/shared) */
DEFINE_func_80155F58() /* dedup: shared engine-core @0x80155F58 (src/shared) */
DEFINE_func_80155F60() /* dedup: shared engine-core @0x80155F60 (src/shared) */
DEFINE_func_80155F80() /* dedup: shared engine-core @0x80155F80 (src/shared) */
DEFINE_func_80155FB0() /* dedup: shared engine-core @0x80155FB0 (src/shared) */
DEFINE_func_80155FD4() /* dedup: shared engine-core @0x80155FD4 (src/shared) */
DEFINE_func_80155FF8() /* dedup: shared engine-core @0x80155FF8 (src/shared) */
void func_80156044(int param_1, int param_2) {
extern u32 func_8015616C(s32 a0, u16 a1);
extern void func_80156670(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
extern void func_801567BC(s32 a0);
extern void func_80156848(s32 a0, s32 a1, s32 a2);
extern void func_80156A88(s32 a0, s32 a1);
extern s32 func_801565C0(s32 a0);
extern u8 D_8018D594;
extern u8 D_8018D5A8;
extern u8 D_8018D42C;
register s32 puVar2 __asm__("$2");
register s32 iVar3 __asm__("$3");
u8 *puVar4;
s32 uVar1;
if (((u32)param_2) & 0x10000) {
iVar3 = (((u32)param_2) & 0xffff) * 0x14;
puVar2 = (s32)&D_8018D594;
} else if (((u32)param_2) & 0x20000) {
iVar3 = (((u32)param_2) & 0xffff) * 0x14;
puVar2 = (s32)&D_8018D5A8;
} else {
iVar3 = (((u32)param_2) & 0xffff) * 0x14;
puVar2 = (s32)&D_8018D42C;
}
puVar4 = (u8 *)(iVar3 + puVar2);
uVar1 = func_8015616C(((s32)param_1), *(u16 *)puVar4) & 0xffff;
if (*(u8 *)(((s32)param_1) + 0x1a8) != 0) {
func_80156670(((s32)param_1), *(s32 *)puVar4, uVar1, *(s32 *)(puVar4 + 4),
*(u8 *)(puVar4 + 0xA), *(u16 *)(puVar4 + 0x12));
if (*(u8 *)(puVar4 + 0x10) != 0) {
func_801567BC(((s32)param_1));
}
func_80156848(((s32)param_1), (s32)puVar4, uVar1);
func_80156A88(((s32)param_1), (s32)puVar4);
if (func_801565C0(((s32)param_1)) != 0) {
*(u8 *)(((s32)param_1) + 0x1c0) = 1;
}
}
}
DEFINE_func_8015616C() /* dedup: shared engine-core @0x8015616C (src/shared) */
DEFINE_func_80156370() /* dedup: shared engine-core @0x80156370 (src/shared) */
DEFINE_func_801563EC() /* dedup: shared engine-core @0x801563EC (src/shared) */
DEFINE_func_8015640C() /* dedup: shared engine-core @0x8015640C (src/shared) */
DEFINE_func_801564B0() /* dedup: shared engine-core @0x801564B0 (src/shared) */
DEFINE_func_801565C0() /* dedup: shared engine-core @0x801565C0 (src/shared) */
// @class: MATCH (18 ins) — match_one, asm-subdir asm/ov_SC01_077/nonmatchings/ov_SC01_077_jr_80154C24
//
// RECONCILE (uc2 -> uc3). The body is UNCHANGED and still MATCHes; only the declaration
// environment moved.
//
// Gate error: `conflicting types for func_80156600 || previous declaration`. The conflicting
// symbol is func_80156600 ITSELF. ov_SC01_077_jr_80154C24.c:1747 instantiates
// DEFINE_func_80157EA4(), whose macro body (src/shared/engine_core.h:11395) carries
// extern s32 func_80156600(void *a0);
// and calls it at engine_core.h:11409 as `v1 = (s32 *)func_80156600(a0);`.
// The byte-true body is NULLARY — the target zeroes $a0 at entry and uses it as the loop
// counter — so `s32 (void)` vs the header's `s32 (void *)` is a PARAM/ARITY disagreement on
// our own definition. Neither declaration can be changed: the header decl is fleet-shared
// (137 siblings instantiate the same macro), and adding a phantom `void *` parameter to the
// definition perturbs the $a0 allocation.
//
// Escape: §37/§124 ASM-LABEL ALIAS. The definition is given the private C name aF80156600
// and the assembler label "func_80156600", so it never collides with the canonical
// declaration while still emitting the required symbol for the macro's call site. Zero
// header edits, zero codegen change (verified: cc1 on the real spliced TU is diagnostic-free,
// and match_one still prints MATCH). This declaration MUST travel with the body.
//
// Everything else is as in uc2: externs at BLOCK scope (rule D — keeps the bank travellable to
// the 137 siblings; the sibling func_80156670 declares the same two symbols at function scope
// in the same TU at :1427/:1432), and D_80126AF0 typed as plain u8[] because the body only
// ever does pointer arithmetic on it (+8/entry) — the file-scope `extern S8 D_80126AF0[];`
// form needs engine_types.h, which common.h does not pull in.
//
// Codegen shape: a counter in $a0, a byte cursor $a1 walking D_80126AF0 by 8, a word cursor
// $v1 walking D_801151E0 by 4; the `addu $v0,$a1,$zero` return value sits in the bnez delay
// slot, and the loop fallthrough re-zeroes $v0 for the not-found return.
s32 aF80156600(void) __asm__("func_80156600");
DEFINE_func_80156600() /* dedup: shared engine-core @0x80156600 (src/shared) */
DEFINE_func_80156648() /* dedup: shared engine-core @0x80156648 (src/shared) */
DEFINE_func_80156670() /* dedup: shared engine-core @0x80156670 (src/shared) */
DEFINE_func_801567BC() /* dedup: shared engine-core @0x801567BC (src/shared) */
DEFINE_func_80156848() /* dedup: shared engine-core @0x80156848 (src/shared) */
DEFINE_func_80156A14() /* dedup: shared engine-core @0x80156A14 (src/shared) */
// @class: struct
// @stuck: none — MATCH expected; D_8011520C indexed by param_2 (byte) folds %lo; D_8018D840 indexed halfword folds %lo
extern unsigned char D_8011520C[];
extern unsigned short D_8018D840[];
extern void func_80147324(s32 arg0);
void func_80156A1C(s32 param_1, s32 param_2)
{
if (*(unsigned char *)(param_1 + 0xDA) == 0) {
func_80147324(D_8018D840[D_8011520C[param_2]]);
*(unsigned char *)(param_1 + 0xDA) = *(unsigned char *)(param_1 + 0xDA) + 1;
}
}
DEFINE_func_80156A88() /* dedup: shared engine-core @0x80156A88 (src/shared) */
DEFINE_func_80156B74() /* dedup: shared engine-core @0x80156B74 (src/shared) */
DEFINE_func_80156ECC() /* dedup: shared engine-core @0x80156ECC (src/shared) */
DEFINE_func_80156FA8() /* dedup: shared engine-core @0x80156FA8 (src/shared) */
DEFINE_func_80157158() /* dedup: shared engine-core @0x80157158 (src/shared) */
DEFINE_func_801571C4() /* dedup: shared engine-core @0x801571C4 (src/shared) */
DEFINE_func_801574DC() /* dedup: shared engine-core @0x801574DC (src/shared) */
DEFINE_func_80157510() /* dedup: shared engine-core @0x80157510 (src/shared) */
DEFINE_func_80157544() /* dedup: shared engine-core @0x80157544 (src/shared) */
DEFINE_func_80157580() /* dedup: shared engine-core @0x80157580 (src/shared) */
DEFINE_func_801575E4() /* dedup: shared engine-core @0x801575E4 (src/shared) */
DEFINE_func_801576A8() /* dedup: shared engine-core @0x801576A8 (src/shared) */
DEFINE_func_8015771C() /* dedup: shared engine-core @0x8015771C (src/shared) */
DEFINE_func_8015773C() /* dedup: shared engine-core @0x8015773C (src/shared) */
// @class: plumbing
// @stuck: none — MATCH expected (scalar global store + two sequential calls, param_1 saved across)
extern int D_801E96D0;
extern void func_80147078(s32 *a0, s16 a1);
extern void func_801578C0(s32 a0);
void func_80157788(int param_1)
{
D_801E96D0 = 300;
((void (*)(int, int))func_80147078)(param_1, 7);
func_801578C0(param_1);
}
void func_801577C8(s32 arg0) {
D_801E96D0 = 0x12C;
func_80147078(arg0, 7);
func_80157808(arg0);
}
// @class: struct
// @stuck: none — MATCH expected (fnptr-table %lo-fold via extern array + global counter decrement + two saved-param calls)
extern void (*D_8018D878[])(void);
extern int D_801E96D0;
extern void func_801599A4(void *a0);
extern void func_80159B3C(void *a0);
void func_80157808(void *param_1)
{
D_8018D878[*(unsigned short *)((char *)param_1 + 2)]();
D_801E96D0 = D_801E96D0 - 1;
if (D_801E96D0 == -1) {
func_801599A4(param_1);
func_80159B3C(param_1);
}
}
DEFINE_func_80157880() /* dedup: shared engine-core @0x80157880 (src/shared) */
// @class: plumbing
// @stuck: none — MATCH (expected); STUB: param_1 held in $s0 across calls, u8 store of 9 before func_80154274
extern void func_80156648(s32 *a0);
extern void func_80154274(s32 *a0, s32 a1);
extern void func_80154A74(s32 a0, s32 a1);
extern void func_80147324(s32 arg0);
extern void func_80146DB8(s32 *a0, s32 *a1);
extern s32 func_80146994(s32 a0, s32 a1, s32 a2, s32 a3);
extern void func_80146CA0(void *a0);
extern s32 func_801725A4(u8 *a0);
extern u8 D_800D5128;
extern u8 D_8018D858;
void func_801578C0(s32 param_1)
{
((void (*)(void))func_80156648)();
*(u8 *)(param_1 + 0x1AA) = 9;
func_80154274((s32 *)param_1, (s32)&D_800D5128);
((void (*)(s32 *, s32))func_80154A74)((s32 *)param_1, 0x15);
func_80147324(0xC20);
((void (*)(s32 *, s32))func_80146DB8)((s32 *)param_1, (s32)&D_8018D858);
((void (*)(s32, s32 *, s32, s32))func_80146994)(4, (s32 *)param_1, 7, 0);
((void (*)(s32, s32 *, s32, s32))func_80146994)(5, (s32 *)param_1, 9, 0);
((void (*)(s32 *))func_80146CA0)((s32 *)param_1);
((void (*)(s32 *))func_801725A4)((s32 *)param_1);
}
// @class: other
// @stuck: none — MATCH (76 ins). Body is byte-identical with a plain transcription; the only
// delta was frame size: target frame is 0x30 (saves at 0x20/0x24/0x28), not 0x20. Target reserves
// a 16-byte UNREFERENCED stack local (no sp refs anywhere in the body) — gcc-2.7.2 does NOT
// dead-strip an aggregate local even at -O2, so a dead `int frame_pad[4]` reproduces vars=16
// (.frame $sp,48: vars=16, regs=3, args=16) with zero body footprint. match_one => MATCH.
extern void func_80147A10(int a0, int a1);
extern void func_80147A84(int);
extern void func_801473EC(s32 *a0);
extern void func_80148038(int, int);
extern void func_80147460(int);
extern void func_8014ED28(s32 _arg0);
extern void func_80146D90(int);
extern void func_80161450(void *a0);
extern void func_80157A8C(int);
extern void func_80146E90(s32 *a0, s32 a1);
extern void func_80146CA0(void *a0);
extern int func_80155FF8(int arg, int a1);
extern void func_80154A74(int, int);
extern void func_80154274(s32 *a0, s32 a1);
extern void func_80146DB8(s32 *a0, s32 *a1);
extern void func_801477E8(s32 *a0, s32 a1);
extern s32 func_801725A4(u8 *a0);
extern unsigned char D_800D5178;
extern unsigned char D_8018D868;
void func_8015795C(int param_1)
{
int frame_pad[4]; /* dead 16-byte local: forces target's 0x30 frame (vars=16); never referenced */
int iVar1;
unsigned int uVar2;
*(unsigned int *)(param_1 + 0x44) = *(unsigned int *)(param_1 + 0x44) | 2;
((int (*)(int, int))func_80147A10)(param_1, 0x400);
if (*(int *)(param_1 + 0x2c) >= 0) {
*(int *)(param_1 + 0x2c) = 0;
}
func_80147A84(param_1);
((void (*)(int))func_801473EC)(param_1);
func_80148038(param_1, 0x1a000);
func_80147460(param_1);
iVar1 = ((int (*)(int))func_8014ED28)(param_1);
if (iVar1 != 0) {
func_80146D90(param_1);
}
uVar2 = ((int (*)(int))func_80161450)(param_1);
if ((uVar2 & 5) != 0) {
func_80157A8C(param_1);
((void (*)(int, int))func_80146E90)(param_1, 8);
((void (*)(int))func_80146CA0)(param_1);
}
if (uVar2 == 0) {
((void (*)(int, int))func_80155FF8)(param_1, *(unsigned char *)(param_1 + 0x1aa));
if (*(unsigned char *)(param_1 + 0x1c0) != 0) {
func_80154A74(param_1, 0x17);
((void (*)(int, void *))func_80154274)(param_1, &D_800D5178);
((void (*)(int, void *))func_80146DB8)(param_1, &D_8018D868);
((void (*)(int, int))func_801477E8)(param_1, 0xfff40000);
*(short *)(param_1 + 2) = 4;
}
((void (*)(int))func_801725A4)(param_1);
}
return;
}
DEFINE_func_80157A8C() /* dedup: shared engine-core @0x80157A8C (src/shared) */
DEFINE_func_80157AC8() /* dedup: shared engine-core @0x80157AC8 (src/shared) */
DEFINE_func_80157B74() /* dedup: shared engine-core @0x80157B74 (src/shared) */
DEFINE_func_80157BC8() /* dedup: shared engine-core @0x80157BC8 (src/shared) */
DEFINE_func_80157CCC() /* dedup: shared engine-core @0x80157CCC (src/shared) */
/* func_80157D20 — 21-ins plumbing shim (×138 overlays).
*
* §71 sibling-first: the immediate neighbour func_801578C0 in this very TU
* (src/ov_SC01_077/ov_SC01_077_jr_80154C24.c L1592) already matches with
* `((void (*)(void))func_80156648)();` — the zero-argument call form. The
* target likewise sets up NO argument registers before `jal func_80156648`
* ($a0/$a1 still carry this function's own incoming args), so the call is
* argument-less here too.
*
* The `lhu %lo(D_8018D8A8)($at)` with `sll $s0,$s0,1` => a plain u16 array
* indexed by the second parameter, NOT hoisted into a pointer (§20: a pointer
* var would keep one address register live across the call; the target rebuilds
* the %hi/%lo pair inline after the call returns).
*
* §73 PARAMS axis / §42 lever 6 — the fleet canon for this symbol is
* `extern void func_80157D20(void);` (this TU's carried decl layer, L399, and
* every sibling overlay's). A 2-param definition hard-errors with
* `conflicting types` in the real TU (rtu_match, byte-verified), and the canon
* cannot be widened from a draft (that is an R22 fleet edit). So keep the
* `(void)` signature and capture $a0/$a1 with register pins copied into NORMAL
* pseudos — the copies are live across `jal func_80156648`, so they get the
* callee-saved homes the target uses ($s1 = a0, $s0 = a1). A direct
* `register` use would leave the values in call-clobbered $a0/$a1.
*/
extern void func_80156648(s32 *a0);
extern void func_80147078(s32 *a0, s16 a1);
extern void func_80157D74(u16 *a0);
void func_80157D20(void)
{
extern u16 D_8018D8A8[];
register void *a0v __asm__("$4");
register s32 a1v __asm__("$5");
void *param_1 = a0v;
s32 param_2 = a1v;
((void (*)(void))func_80156648)();
((void (*)(void *, s32))func_80147078)(param_1, D_8018D8A8[param_2]);
((void (*)(void *))func_80157D74)(param_1);
}
DEFINE_func_80157D74() /* dedup: shared engine-core @0x80157D74 (src/shared) */
DEFINE_func_80157DC4() /* dedup: shared engine-core @0x80157DC4 (src/shared) */
DEFINE_func_80157E00() /* dedup: shared engine-core @0x80157E00 (src/shared) */
DEFINE_func_80157E38() /* dedup: shared engine-core @0x80157E38 (src/shared) */
DEFINE_func_80157EA4() /* dedup: shared engine-core @0x80157EA4 (src/shared) */
DEFINE_func_80157F64() /* dedup: shared engine-core @0x80157F64 (src/shared) */
DEFINE_func_80157FC4() /* dedup: shared engine-core @0x80157FC4 (src/shared) */
DEFINE_func_80158000() /* dedup: shared engine-core @0x80158000 (src/shared) */
// @class: plumbing
// @stuck: none — MATCH (expected); straight-line call sequence with two stores scheduled into jal delay slots
extern void func_80154274(s32 *a0, s32 a1);
extern void func_80154A74(s32 a0, s32 a1);
extern void func_80146DB8(s32 *a0, s32 *a1);
extern s32 func_80146994(s32 a0, s32 a1, s32 a2, s32 a3);
extern void func_80147324(s32 arg0);
extern void func_80146CA0(void *a0);
extern s32 D_800D51E0;
extern s32 D_8018D88C;
void func_80158038(void * param)
{
*(u8 *)(param + 0x1aa) = 0xe;
func_80154274((s32 *)param, (s32)&D_800D51E0);
func_80154A74(param, 0x15);
func_80146DB8((s32 *)param, &D_8018D88C);
*(s32 *)(param + 0x234) = 0;
func_80146994(5, param, 0xc, 0);
func_80147324(0x455);
func_80146CA0((void *)param);
}
DEFINE_func_801580B4() /* dedup: shared engine-core @0x801580B4 (src/shared) */
DEFINE_func_801581AC() /* dedup: shared engine-core @0x801581AC (src/shared) */
DEFINE_func_8015824C() /* dedup: shared engine-core @0x8015824C (src/shared) */
DEFINE_func_80158288() /* dedup: shared engine-core @0x80158288 (src/shared) */
DEFINE_func_801582C0() /* dedup: shared engine-core @0x801582C0 (src/shared) */
DEFINE_func_80158344() /* dedup: shared engine-core @0x80158344 (src/shared) */
// @class: other
// @stuck: none — MATCH (branch-polarity invert on both dispatch ifs + goto block-order to put the v1!=0/L508 paths as fallthrough; phantom 0x10 frame via address-taken frame_pad[4] + (void)& — zero code)
extern void func_8014CBF8(void *a0);
extern void func_801474EC(s32 *a0);
extern void func_801477E8(s32 *a0, s32 a1);
extern void func_80146DB8(s32 *a0, s32 *a1);
extern void func_80148038(s32 a0, s32 a1);
extern void func_80147460(s32 a0);
extern void func_80147AD4(s32 a0, s32 a1, s32 a2, s32 a3);
extern void func_801473EC(s32 *a0);
extern s32 func_801615C4(void *a0, s32 a1);
extern s32 func_80146E98(s32 a0);
extern void func_80154274(s32 *a0, s32 a1);
extern void func_80146CA0(void *a0);
extern int func_80155FF8(int arg, int a1);
extern u8 D_8018D89C;
extern u8 D_800D533C;
void func_80158434(s32 param_1)
{
u32 uVar1;
u32 uVar2;
s32 frame_pad[4];
(void)&frame_pad;
*(u32 *)(param_1 + 0x44) = *(u32 *)(param_1 + 0x44) | 2;
if ((*(u16 *)(param_1 + 0xB8) & 0x4000) != 0) {
*(s32 *)(param_1 + 0x234) = *(s32 *)(param_1 + 0x234) + 1;
((s32 (*)(void))func_8014CBF8)();
((void (*)(s32))func_801474EC)(param_1);
((void (*)(s32, s32))func_801477E8)(param_1, 0xFFFA0000);
((void (*)(s32, s32))func_80146DB8)(param_1, (s32)&D_8018D89C);
}
if (*(s32 *)(param_1 + 0x234) != 0) {
func_80148038(param_1, 0x10000);
func_80147460(param_1);
func_80147AD4(param_1, 0, 0, 0);
((void (*)(s32))func_801473EC)(param_1);
}
uVar1 = ((s32 (*)(s32, s32))func_801615C4)(param_1, 0);
if (uVar1 != 0) {
if (uVar1 == 1) goto LAB_80158508;
uVar2 = uVar1 & 0x2000;
} else {
uVar2 = func_80146E98(param_1);
}
if (uVar2 == 0) goto LAB_80158528;
LAB_80158508:
((void (*)(s32, s32))func_80154274)(param_1, (s32)&D_800D533C);
((void (*)(s32))func_80146CA0)(param_1);
return;
LAB_80158528:
((void (*)(s32, s32))func_80155FF8)(param_1, *(u8 *)(param_1 + 0x1AA));
}
DEFINE_func_80158548() /* dedup: shared engine-core @0x80158548 (src/shared) */
DEFINE_func_801585A4() /* dedup: shared engine-core @0x801585A4 (src/shared) */
DEFINE_func_801585AC() /* dedup: shared engine-core @0x801585AC (src/shared) */
DEFINE_func_801585EC() /* dedup: shared engine-core @0x801585EC (src/shared) */
// @class: loose-typing
// @stuck: none — MATCH (87 ins, match_one) + symcheck SYMS-OK (17 symbols agree); same file also
// MATCHes verbatim against ov_SC03_099 and ov_SC06_008 (sibling asm bodies are identical)
/* func_80158638 @ 0x80158638 — ov_SC01_077 / ov_SC01_077_jr_80154C24 (87 ins).
*
* TWO decl-ROBUSTNESS choices in the BODY, deliberate — these are the only two things the gate's
* decl ladder (cast_call_sites/reconcile_tu/sig_unify) CANNOT repair, because they change codegen,
* not plumbing. Both are load-bearing for templating this exemplar onto its 138 h_seq siblings,
* where each overlay TU carries its own spelling of these decls:
*
* 1) `*(u16 *)&D_80078EB4` — the target loads it with `lhu`. The ov_SC01_077 TU already carries
* `extern s16 D_80078EB4;` (line 504), and a plain `D_80078EB4 != 0` read through an s16 decl
* compiles to `lh` => WIDTH/lh!=lhu, closeness 1. A `(u16)` cast does NOT fix it (gcc-2.7.2
* folds the zero_extend away for a !=0 test and keeps `lh`); the pointer pun does, and it is
* correct under EITHER declared signedness.
* 2) `(s16)func_80159464(...)` with the fleet-canonical `extern s32 func_80159464();` decl.
* The target truncates the return to 16 bits at BOTH call sites (`sll 16` + `blez`, then
* `sll 16`/`sra 16`/`slti 6`). Declaring the callee `s16` also matches, but the fleet's carried
* decl layer spells it `extern s32 func_80159464(void);` in 1600 places — if reconcile_tu wins
* that conflict the truncation vanishes and the match dies. The explicit cast makes the body
* independent of which decl survives.
*
* Symbols verified present in build/ov_SC01_077/undefined_syms_auto.txt:
* D_80078EB4=0x80078EB4 D_800B9A17=0x800B9A17 D_800B9A64=0x800B9A64 D_80110EC0=0x80110EC0
*/
DEFINE_func_80158638() /* dedup: shared engine-core @0x80158638 (src/shared) */
DEFINE_func_80158794() /* dedup: shared engine-core @0x80158794 (src/shared) */
// @class: plumbing
// @stuck: none — MATCH expected (3 scalar global stores + byte store + 6 calls, source order)
extern s32 D_801E96D8;
extern s32 D_801E96E4;
extern s32 D_801E96E8;
extern void func_80147084(s32 *a0);
extern void func_80147098(s32 *a0);
extern void func_801470AC(s32 *a0);
extern void func_80147078(s32 *a0, s16 a1);
extern void func_80146C98(s32 *a0, s16 a1);
extern void func_80158880(s32 *param);
void func_8015879C(s32 param_1) {
D_801E96D8 = 0;
D_801E96E4 = 1;
D_801E96E8 = 0;
*(u8 *)(param_1 + 0xa8) = 0;
((void (*)(void))func_80147084)();
((void (*)(s32))func_80147098)(param_1);
((void (*)(s32))func_801470AC)(param_1);
((void (*)(s32, s32))func_80147078)(param_1, 0x1a);
((void (*)(s32, s32))func_80146C98)(param_1, 1);
((void (*)(s32))func_80158880)(param_1);
}
// @class: plumbing
// @stuck: none — MATCH (STUB: 3 global stores + byte store + 5 calls in source order)
extern s32 D_801E96D8;
extern s32 D_801E96E4;
extern s32 D_801E96E8;
extern void func_80147084(s32 *a0);
extern void func_80147098(s32 *a0);
extern void func_801470AC(s32 *a0);
extern void func_80147078(s32 *a0, s16 a1);
extern void func_80158880(s32 *param);
void func_80158814(void *arg0) {
D_801E96D8 = 0;
D_801E96E4 = 1;
D_801E96E8 = 0;
*(s8 *)((s32)arg0 + 0xA8) = 0;
((void (*)(void))func_80147084)();
((void (*)(void *))func_80147098)(arg0);
((void (*)(void *))func_801470AC)(arg0);
((void (*)(void *, s32))func_80147078)(arg0, 0x1A);
((void (*)(void *))func_80158880)(arg0);
}
extern void func_80149020(s32 *a0);
extern void (*D_8018D908[])(s32 *);
void func_80158880(s32 *param) {
func_80149020(param);
D_8018D908[*(u8 *)((s32)param + 0x4F)](param);
}
-337
View File
@@ -1,337 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_801588CC() /* dedup: shared engine-core @0x801588CC (src/shared) */
DEFINE_func_80158AB4() /* dedup: shared engine-core @0x80158AB4 (src/shared) */
DEFINE_func_80158AE4() /* dedup: shared engine-core @0x80158AE4 (src/shared) */
extern void func_80146CA0(void *a0);
extern s32 func_801472C8(struct S *a0);
extern void func_80147324(s32 a0);
extern void func_801474D8(s32 *a0);
extern void func_801474EC(s32 *a0);
extern void func_80154274(s32 *a0, s32 a1);
extern void func_80154A74(s32 a0, s32 a1);
extern M2C_UNK D_800D58D8;
extern s32 D_801E96D8;
void func_80158BB0(void *arg0) {
if (D_801E96D8 == 0) {
D_801E96D8 = 1;
}
func_80147324(0x456);
func_80154274(arg0, &D_800D58D8);
func_80154A74(arg0, 0x16);
M2C_FIELD(arg0, s32 *, 0x234) = 0xE30000;
M2C_FIELD(M2C_FIELD(arg0, void **, 0x20), s16 *, 0x10) = 0;
func_801474EC(arg0);
func_801474D8(arg0);
func_801472C8(arg0);
func_80146CA0(arg0);
}
DEFINE_func_80158C40() /* dedup: shared engine-core @0x80158C40 (src/shared) */
DEFINE_func_80158CD8() /* dedup: shared engine-core @0x80158CD8 (src/shared) */
DEFINE_func_80158D60() /* dedup: shared engine-core @0x80158D60 (src/shared) */
DEFINE_func_80158E24() /* dedup: shared engine-core @0x80158E24 (src/shared) */
// @class: other
// @stuck: none — MATCH (signed %11 magic + word-array %lo fold; ((void (*)(int))func_80146CA0)(param_1) reuses $a0 for the 0x198 store in its jal delay slot)
extern s32 D_801E96E4;
extern s32 D_8018D8DC[];
extern int rand(void);
extern s32 func_8013767C(s32 a0);
extern void func_80146CA0(void *a0);
void func_80158F00(int param_1) {
int *self = (int *)param_1;
struct Actor *act = (struct Actor *)self[0x20 / 4];
int gate = D_801E96E4;
act->timer = (u16)((act->timer + 0x16) & 0xfff);
if (gate == 0) {
s32 r = rand();
*(s32 *)(param_1 + 0x198) = func_8013767C(D_8018D8DC[r % 0xb]);
((void (*)(int))func_80146CA0)(param_1);
}
}
// @class: plumbing
// @stuck: none — MATCH (51 ins). Key: func_801594E8 takes a 2nd arg = sVar1 (the (short)func_80159464
// return). $a1 is set by sra BEFORE the beqz and stays live into the jal, so the value is used
// twice (branch test + arg2) — that 2nd use is what keeps the sll;sra (gcc folds sll;sra;beqz
// -> sll;beqz otherwise). Also: branch-polarity invert (!=0 -> 594E8 fall-through, else 767C);
// func_8013767C arg is &(*(u8 *)&D_80110C3C) (lui%hi+addiu%lo, not a literal). Ghidra missed the 2nd arg.
extern s32 D_801E96E8;
extern u8 D_80110C3C[];
extern u16 func_80148800(s32 *a0);
extern s32 func_801399F0(s32);
extern void func_80139914(s32);
extern s32 func_80159464(void);
extern void func_801594E8(s32, s32);
extern void func_80146C98(s32 *a0, s16 a1);
extern s32 func_8013767C(s32 a0);
extern void func_80146CA0(void *a0);
void func_80158FA4(s32 param_1)
{
s32 v0;
s16 sVar1;
v0 = *(s32 *)(param_1 + 0x20);
*(u16 *)(v0 + 0x12) = (*(u16 *)(v0 + 0x12) + 0x16) & 0xfff;
if (((s32 (*)(void))func_80148800)() & 0xf0) {
D_801E96E8 = 1;
}
if (func_801399F0(*(s32 *)(param_1 + 0x198)) != 0) {
func_80139914(*(s32 *)(param_1 + 0x198));
*(s32 *)(param_1 + 0x198) = 0;
sVar1 = ((s32 (*)(s32))func_80159464)(param_1);
if (sVar1 != 0) {
func_801594E8(param_1, sVar1);
((void (*)(s32, s32))func_80146C98)(param_1, 0xc);
} else {
*(s32 *)(param_1 + 0x198) = ((s32 (*)(u8 *))func_8013767C)(&(*(u8 *)&D_80110C3C));
((void (*)(s32))func_80146CA0)(param_1);
}
}
}
DEFINE_func_80159070() /* dedup: shared engine-core @0x80159070 (src/shared) */
DEFINE_func_80159120() /* dedup: shared engine-core @0x80159120 (src/shared) */
DEFINE_func_801592CC() /* dedup: shared engine-core @0x801592CC (src/shared) */
extern void func_80145BF8(void);
extern void func_80146CA0(void *a0);
extern u8 D_800AE6BD;
extern s32 D_801E96D8;
extern s32 D_801E96E0;
void func_8015934C(void *arg0) {
void *temp_v1;
if (D_801E96D8 == 4) {
D_801E96D8 = 5;
}
if (D_801E96E0 != 0) {
func_80145BF8();
func_80146CA0(arg0);
D_800AE6BD += 1;
}
temp_v1 = M2C_FIELD(arg0, void **, 0x20);
M2C_FIELD(temp_v1, u16 *, 0x12) = (u16) ((M2C_FIELD(temp_v1, u16 *, 0x12) + 0x16) & 0xFFF);
}
DEFINE_func_801593E4() /* dedup: shared engine-core @0x801593E4 (src/shared) */
DEFINE_func_80159404() /* dedup: shared engine-core @0x80159404 (src/shared) */
DEFINE_func_80159434() /* dedup: shared engine-core @0x80159434 (src/shared) */
extern s16 currentLocationId;
extern s32 func_80029A94(s32);
extern Entry D_8018D944[];
s32 func_80159464(void) {
Entry *e;
e = D_8018D944;
while (e->id != 0) {
if (currentLocationId == e->id) {
return e->val;
}
e++;
}
if (func_80029A94(1) != 0) {
goto ret0;
}
if (func_80029A94(0) != 0) {
goto ret0;
}
return -1;
ret0:
return 0;
}
DEFINE_func_801594E8() /* dedup: shared engine-core @0x801594E8 (src/shared) */
DEFINE_func_80159698() /* dedup: shared engine-core @0x80159698 (src/shared) */
DEFINE_func_801596D4() /* dedup: shared engine-core @0x801596D4 (src/shared) */
// @class: iv-combine
// @stuck: none — MATCH (97 ins). Recipe: $s0=base=&(*(u8 *)&D_800AF630) hoisted at top; loop1 = for(p=base+0x65A8;
// p<base+0x9DA8;p+=0xe) p[1]|=... (the +4 field-offset store folds into the reduced IV -> gcc emits the
// -4 loop-inversion guard + reuses END for END+4). BOTHER: loop2 needs ab=&D_800AFAE8 POST-guard as a
// shared base for A=ab+1,B=ab+0x22 -> a for-loop hoists it PRE-guard (fold or perm); the fix is a manual
// guarded do-while `if(base+0x2A8<base+0x65A8){ ... do{}while(q<inline base+0x65AC);}` with a DISTINCT loop
// var (q, not p) so loop1's biv-elim survives, an INLINE while-bound (frees the delay slot for the OR
// const), and the OR const HOISTED to a var declared first so it fills the guard delay slot (a3) and A/B
// fall into a2/a1. Barrier after the two 0x7fff stores fixes their vs the loop-guard-low ordering.
DEFINE_func_801596F0() /* dedup: shared engine-core @0x801596F0 (src/shared) */
DEFINE_func_80159874() /* dedup: shared engine-core @0x80159874 (src/shared) */
DEFINE_func_8015987C() /* dedup: shared engine-core @0x8015987C (src/shared) */
DEFINE_func_801598BC() /* dedup: shared engine-core @0x801598BC (src/shared) */
DEFINE_func_801598E0() /* dedup: shared engine-core @0x801598E0 (src/shared) */
DEFINE_func_80159968() /* dedup: shared engine-core @0x80159968 (src/shared) */
DEFINE_func_801599A4() /* dedup: shared engine-core @0x801599A4 (src/shared) */
DEFINE_func_801599E0() /* dedup: shared engine-core @0x801599E0 (src/shared) */
DEFINE_func_80159A18() /* dedup: shared engine-core @0x80159A18 (src/shared) */
// @class: struct
// Redraft of the DECAYED backlog draft. The stored seed took `void *param_1` and then
// dereferenced it (`param_1[0xdd]`) — gcc-2.7.2 rejects that ("void value not ignored
// as it ought to be"), so the seed no longer compiles at all. Fix: retype the parameter
// as `unsigned char *`, which keeps every pointer offset byte-scaled (as void* arith did)
// while making the byte load legal.
// Structure preserved from the seed: the two return-tests are kept STRUCTURALLY
// DIFFERENT (positive `if(==) goto mask;` per branch, not `if(!=) return;`) so gcc's
// cross-jump pass cannot tail-merge them; and the outer test is inverted (`if(d != 1)`)
// so the ==4/return path is the inline fall-through and the d==1 / p[2] path becomes the
// forward beq-target block — matching the target block order.
// Typedefs are BLOCK-SCOPE so the match travels to the sibling overlays.
extern void (*D_8018DCAC[])(unsigned char *);
extern void func_80150B28(int param_1);
extern void func_80158638(unsigned char *);
extern void func_8015126C(unsigned short *);
extern void func_8014900C(int *a0);
void func_80159A20(unsigned char *param_1)
{
typedef unsigned short u16;
typedef unsigned int u32;
typedef int s32;
typedef unsigned char u8;
((s32 (*)(void))func_80150B28)();
func_80158638(param_1);
((void (*)(u8 *))func_8015126C)(param_1);
((void (*)(u8 *))func_8014900C)(param_1);
D_8018DCAC[*(u16 *)param_1 & 0x7fff](param_1);
*(u32 *)(param_1 + 0x44) |= 0x8000000;
switch (*(u16 *)param_1) {
case 2:
case 3:
case 0xb:
case 0xc:
goto mask;
default:
return;
case 0x19:
if (param_1[0xdd] != 1) {
if (param_1[0xdd] == 4) {
goto mask;
}
return;
}
if (*(u16 *)(param_1 + 2) == 3) {
goto mask;
}
return;
}
mask:
*(u32 *)(param_1 + 0x44) &= 0xf7ffffff;
}
DEFINE_func_80159B08() /* dedup: shared engine-core @0x80159B08 (src/shared) */
DEFINE_func_80159B3C() /* dedup: shared engine-core @0x80159B3C (src/shared) */
DEFINE_func_80159B70() /* dedup: shared engine-core @0x80159B70 (src/shared) */
DEFINE_func_80159BAC() /* dedup: shared engine-core @0x80159BAC (src/shared) */
// @class: schedule
// @stuck: none — MATCH (40 ins). Duplicate func_80154A74(arg0,K) into BOTH branch arms (not a
// single shared-join call): forces gcc to cross-jump the jal while keeping per-arm
// `addu $a0,$s0` setup + a `nop` join delay slot, matching the 40-ins layout. Branch
// polarity: write `if (flag & 0x200 != 0){5,0x1C} else {4,0x11}` to get the `beqz`.
extern void func_80146DB8(s32 *a0, s32 *a1);
extern void func_80154150(s32 a0, s32 a1);
extern void func_80154A74(s32 a0, s32 a1);
extern void func_801553C0(s32 a0);
extern void func_801553A8(s32 *a0);
extern s32 func_80172590(u8 *a0);
extern void func_80146CA0(void *a0);
extern unsigned char D_8018DB6C;
void func_80159BE4(s32 arg0)
{
int v;
((void (*)(int, void *))func_80146DB8)(arg0, &D_8018DB6C);
if ((*(unsigned int *)(arg0 + 0x44) & 0x200) != 0) {
func_80154150(arg0, 5);
func_80154A74(arg0, 0x1C);
} else {
func_80154150(arg0, 4);
func_80154A74(arg0, 0x11);
}
*(int *)(arg0 + 0x234) = 0;
*(int *)(arg0 + 0x238) = 0;
func_801553C0(arg0);
((void (*)(int))func_801553A8)(arg0);
((void (*)(int))func_80172590)(arg0);
((void (*)(int))func_80146CA0)(arg0);
}
-73
View File
@@ -1,73 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_80159C84() /* dedup: shared engine-core @0x80159C84 (src/shared) */
DEFINE_func_8015A1C8() /* dedup: shared engine-core @0x8015A1C8 (src/shared) */
DEFINE_func_8015A1FC() /* dedup: shared engine-core @0x8015A1FC (src/shared) */
DEFINE_func_8015A230() /* dedup: shared engine-core @0x8015A230 (src/shared) */
DEFINE_func_8015A264() /* dedup: shared engine-core @0x8015A264 (src/shared) */
DEFINE_func_8015A2A0() /* dedup: shared engine-core @0x8015A2A0 (src/shared) */
// @class: other
// @stuck: none — MATCH (60 ins). switch() gives signed slti pivot; per-case duplicated call gives per-case a0 setup + nop jal delay
extern int D_8018DB7C;
extern void func_80146DB8(s32 *a0, s32 *a1);
extern void func_80154150(s32 a0, s32 a1);
extern void func_80154A74(s32 a0, s32 a1);
extern void func_8014C010(s32 a0, s32 a1);
extern void func_801553A8(s32 *a0);
extern s32 func_80172608(u8 *a0);
extern void func_80146CA0(void *a0);
void func_8015A2D8(s32 param_1)
{
unsigned char bVar1;
((void (*)(int, int *))func_80146DB8)(param_1, &D_8018DB7C);
if ((*(unsigned int *)(param_1 + 0x44) & 0x200) != 0) {
func_80154150(param_1, 10);
func_80154A74(param_1, 0x1c);
*(int *)(param_1 + 0x2c) = 0xfffc0000;
goto LAB_8015a38c;
}
bVar1 = *(unsigned char *)(param_1 + 0xa9);
switch (bVar1) {
case 0x41:
func_80154150(param_1, 7);
break;
case 0x53:
case 0x73:
func_80154150(param_1, 6);
break;
default:
*(int *)(param_1 + 0x23c) = 0;
goto LAB_8015a390;
}
func_80154A74(param_1, 0x21);
LAB_8015a38c:
*(int *)(param_1 + 0x23c) = 0;
LAB_8015a390:
func_8014C010(param_1, 2);
((void (*)(int))func_801553A8)(param_1);
((void (*)(int))func_80172608)(param_1);
((void (*)(int))func_80146CA0)(param_1);
return;
}
-46
View File
@@ -1,46 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_8015A3C8() /* dedup: shared engine-core @0x8015A3C8 (src/shared) */
DEFINE_func_8015AB7C() /* dedup: shared engine-core @0x8015AB7C (src/shared) */
DEFINE_func_8015ABD4() /* dedup: shared engine-core @0x8015ABD4 (src/shared) */
// @class: plumbing
// @stuck: none — MATCH (param held in $s0 across 3 calls; lhu 0x16E; &D_8018DB9C arg)
extern void func_80154150(s32 a0, s32 a1);
extern void func_80146DB8(s32 *a0, s32 *a1);
extern s32 func_80161CD0(s32 a0, s32 a1);
extern M2C_UNK D_8018DB9C;
void func_8015AC48(s32 arg0)
{
func_80154150(arg0, 9);
func_80146DB8((s32 *)arg0, &D_8018DB9C);
func_80161CD0(arg0, M2C_FIELD(arg0, u16 *, 0x16E));
}
DEFINE_func_8015AC90() /* dedup: shared engine-core @0x8015AC90 (src/shared) */
DEFINE_func_8015ACC4() /* dedup: shared engine-core @0x8015ACC4 (src/shared) */
DEFINE_func_8015AD08() /* dedup: shared engine-core @0x8015AD08 (src/shared) */
DEFINE_func_8015AD3C() /* dedup: shared engine-core @0x8015AD3C (src/shared) */
DEFINE_func_8015AD78() /* dedup: shared engine-core @0x8015AD78 (src/shared) */
DEFINE_func_8015ADB0() /* dedup: shared engine-core @0x8015ADB0 (src/shared) */
-124
View File
@@ -1,124 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
DEFINE_func_8015AE2C() /* dedup: shared engine-core @0x8015AE2C (src/shared) */
DEFINE_func_8015B6F4() /* dedup: shared engine-core @0x8015B6F4 (src/shared) */
DEFINE_func_8015B7B4() /* dedup: shared engine-core @0x8015B7B4 (src/shared) */
DEFINE_func_8015B858() /* dedup: shared engine-core @0x8015B858 (src/shared) */
DEFINE_func_8015B8F8() /* dedup: shared engine-core @0x8015B8F8 (src/shared) */
DEFINE_func_8015B950() /* dedup: shared engine-core @0x8015B950 (src/shared) */
DEFINE_func_8015BD8C() /* dedup: shared engine-core @0x8015BD8C (src/shared) */
DEFINE_func_8015BDD0() /* dedup: shared engine-core @0x8015BDD0 (src/shared) */
DEFINE_func_8015BE04() /* dedup: shared engine-core @0x8015BE04 (src/shared) */
DEFINE_func_8015BE38() /* dedup: shared engine-core @0x8015BE38 (src/shared) */
DEFINE_func_8015BE74() /* dedup: shared engine-core @0x8015BE74 (src/shared) */
DEFINE_func_8015BE94() /* dedup: shared engine-core @0x8015BE94 (src/shared) */
DEFINE_func_8015BEC4() /* dedup: shared engine-core @0x8015BEC4 (src/shared) */
DEFINE_func_8015BEE4() /* dedup: shared engine-core @0x8015BEE4 (src/shared) */
DEFINE_func_8015BF04() /* dedup: shared engine-core @0x8015BF04 (src/shared) */
DEFINE_func_8015BF48() /* dedup: shared engine-core @0x8015BF48 (src/shared) */
DEFINE_func_8015BF7C() /* dedup: shared engine-core @0x8015BF7C (src/shared) */
DEFINE_func_8015BFB0() /* dedup: shared engine-core @0x8015BFB0 (src/shared) */
DEFINE_func_8015BFF4() /* dedup: shared engine-core @0x8015BFF4 (src/shared) */
/* §71 sibling-first: this is DEFINE_func_8015C0C4 (src/shared/engine_core.h L8919)
* with the two globals replaced by the second parameter and <<6 -> <<7.
* The explicit temporary `t` keeps the first lh ahead of the 0x238 store.
*
* Signature is the fleet canon `(s32 *a0, s32 a1)` declared by
* DEFINE_func_8015BFB0 (engine_core.h L16218) — a private `(s32, s16 *)`
* definition also match_one-MATCHes but breaks the real TU with
* `conflicting types`. The s16 reads are cast at the use site. */
DEFINE_func_8015C030() /* dedup: shared engine-core @0x8015C030 (src/shared) */
DEFINE_func_8015C08C() /* dedup: shared engine-core @0x8015C08C (src/shared) */
DEFINE_func_8015C0C4() /* dedup: shared engine-core @0x8015C0C4 (src/shared) */
#include "common.h"
s32 func_8015C128(s32 param_1) {
extern void func_8015C6E0(int);
extern void (*D_8018DC08[])(int);
int sp10[3];
int sp20[3];
int temp_s0;
int temp_v0;
((void(*)())func_80149FB0)();
if (((int(*)(int))func_80148AFC)(((int)param_1)) & 0xFF) {
sp10[0] = 0;
sp10[1] = 0;
sp10[2] = -0x4000;
((void(*)(int, int *, int *))func_8001382C)(*(short *)(*(int *)(((int)param_1) + 0x20) + 0x12), sp10, sp20);
*(int *)(((int)param_1) + 0x234) += sp20[0];
*(int *)(((int)param_1) + 0x238) += sp20[1];
*(int *)(((int)param_1) + 0x23C) += sp20[2];
}
((void(*)(int, int *, int *))func_8001382C)((short)(-*(unsigned short *)(*(int *)(((int)param_1) + 0x20) + 0x12)),
(int *)(((int)param_1) + 0x234), sp20);
((void(*)(int, int *))func_80146DB8)(((int)param_1), sp20);
func_80147A84(((int)param_1));
((void(*)(int))func_801473EC)(((int)param_1));
if (!(D_800B99DA & 3)) {
((void(*)(int, int))func_8014C010)(((int)param_1), 1);
((void(*)(int))func_80147324)(0x65F);
}
if (((int(*)(int))func_8014D738)(((int)param_1)) != 0) {
D_8018DC08[*(u16 *)((int)param_1)](((int)param_1));
func_8015C6E0(((int)param_1));
return;
}
temp_s0 = ((int(*)(int))func_8014CC28)(((int)param_1));
temp_v0 = ((int(*)(int))func_8014F3E8)(((int)param_1));
if (temp_v0 != 0) {
if ((temp_v0 & 0xFF00) != 0x4000) {
((void(*)(int, int))func_80146E90)(((int)param_1), 6);
((void(*)(int))func_80146CA0)(((int)param_1));
return;
}
if ((temp_v0 & 0x4000) && ((int(*)(int))func_80146E98)(((int)param_1)) != 0) {
((void(*)(int, int))func_80147078)(((int)param_1), 4);
((void(*)(int))func_8015C0C4)(((int)param_1));
}
} else if (temp_s0 == 0) {
D_8018DC08[*(u16 *)((int)param_1)](((int)param_1));
((void(*)(int, int))func_80147078)(((int)param_1), 3);
((void(*)(int))func_8015BE94)(((int)param_1));
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-30
View File
@@ -1,30 +0,0 @@
#include "common.h"
#include "../shared/func_80144B9C.h"
/* func_801457A4 @ 0x801457A4 — an -O0 function stranded at the whale's end boundary (it is the
* FIRST fn of the -O2 "after" segment, but its target is -O0: frame-pointer + per-case stack
* reloads). It can only bank in an -O0 object, so it lives here: _o0b is already -O0-compiled and
* its .text ends exactly at 0x801457A4 (right after func_80144B9C), placing this fn at its true
* address with no linker/Makefile change. Its stub was removed from ov_SC01_077_after.c. Def sig
* conformed byte-neutrally to func_80144B9C.h's decl `void *func_801457A4(s32)` (the whale calls it
* that way); byte-proven at -O0 (match_one --o0 79/79) and by the whole-binary gate. Phase-29 bank. */
extern int D_8018B520;
void *func_801457A4(s32 param_1) {
switch (param_1) {
case 0x1010:
case 0x1052:
case 0x1077:
case 0x1094:
case 0x2013:
case 0x2015 ... 0x201a:
case 0x2055 ... 0x205b:
case 0x207a ... 0x2080:
case 0x2097 ... 0x209d:
return (void *)(&D_8018B520)[param_1 & 0xffff0fff];
default:
return (void *)D_8018B520;
break;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-859
View File
@@ -1,859 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
DEFINE_func_80128158() /* dedup: shared engine-core @0x80128158 (src/shared) */
DEFINE_func_80128178() /* dedup: shared engine-core @0x80128178 (src/shared) */
DEFINE_func_80128198() /* dedup: shared engine-core @0x80128198 (src/shared) */
DEFINE_func_801281B8() /* dedup: shared engine-core @0x801281B8 (src/shared) */
DEFINE_func_801281D8() /* dedup: shared engine-core @0x801281D8 (src/shared) */
DEFINE_func_801281F8() /* dedup: shared engine-core @0x801281F8 (src/shared) */
extern s32 D_801E4434;
s32 func_80128218(void) {
return D_801E4434;
}
DEFINE_func_80128228() /* dedup: shared engine-core @0x80128228 (src/shared) */
DEFINE_func_80128248() /* dedup: shared engine-core @0x80128248 (src/shared) */
DEFINE_func_80128268() /* dedup: shared engine-core @0x80128268 (src/shared) */
extern u16 D_800B99F6;
extern void (*D_8018D4AC[])(void);
void func_80128288(void) {
u32 v1;
v1 = D_800B99F6;
if (v1 < 9) {
D_8018D4AC[v1]();
}
}
DEFINE_func_801282CC() /* dedup: shared engine-core @0x801282CC (src/shared) */
DEFINE_func_801282EC() /* dedup: shared engine-core @0x801282EC (src/shared) */
DEFINE_func_8012832C() /* dedup: shared engine-core @0x8012832C (src/shared) */
DEFINE_func_80128420() /* dedup: shared engine-core @0x80128420 (src/shared) */
DEFINE_func_801284B8() /* dedup: shared engine-core @0x801284B8 (src/shared) */
DEFINE_func_801284F0() /* dedup: shared engine-core @0x801284F0 (src/shared) */
DEFINE_func_8012853C() /* dedup: shared engine-core @0x8012853C (src/shared) */
DEFINE_func_80128564() /* dedup: shared engine-core @0x80128564 (src/shared) */
DEFINE_func_801285D4() /* dedup: shared engine-core @0x801285D4 (src/shared) */
extern s32 func_800D18DC(void);
extern void func_8014607C(void);
extern void func_801287B8(void);
extern s32 func_80011A3C(void);
extern s32 D_801E5A14;
void func_801285E4(void)
{
__asm__ __volatile__(
".set noreorder\n"
"addiu $sp, $sp, -24\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"sw $ra, 16($sp)\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_800D18DC\n"
"lui $at, %%hi(D_801E5A14)\n"
"sw $v0, %%lo(D_801E5A14)($at)\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"jal func_8014607C\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_801287B8\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"lui $v0, %%hi(D_801E5A14)\n"
"lw $v0, %%lo(D_801E5A14)($v0)\n"
"nop\n"
"beqz $v0, 1f\n"
"nop\n"
"jal func_80011A3C\n"
"1:\n"
"lw $ra, 16($sp)\n"
"addiu $sp, $sp, 24\n"
: : : "memory");
}
DEFINE_func_80128678() /* dedup: shared engine-core @0x80128678 (src/shared) */
// @class: other
// @stuck: none — MATCH (handwritten full inline-asm scratchpad-stack-switch wrapper w/ branch)
/*
* HANDWRITTEN scratchpad-stack-switch dispatcher (same idiom as func_80128564 /
* the func_8014ED28 family): repoints $sp into the D-cache scratchpad stack held
* at *(0x1F8003FC), calls func_800D19F0, stashes its $v0 result through D_801E5A14,
* restores $sp, then dispatches on the stored value:
* if (D_801E5A14 != 0) { func_8001903C(); func_80018FC8(); }
* else { func_8014607C(); <scratchpad-switch> func_801287B8(); }
* Manipulating $sp is not expressible in C; full inline asm (manages its own frame).
*
* NOTE (maspsx --aspsx-version=2.56): the inline ".set noreorder" is written with a
* SPACE, so maspsx's own is_reorder tracker stays True and it auto-fills EVERY
* jal/j/branch delay slot with a nop (GNU as honors noreorder and adds none). So do
* NOT write explicit delay-slot nops after jal/j/bne — that yields a double nop.
* bnez is written as `bne $v0,$zero` so maspsx recognizes it (bnez isn't in its
* branch set). The load-delay nop after `lw $v0,%lo(...)($v0)` is auto-inserted too.
* %hi/%lo escaped as %%hi/%%lo (bare % is an operand placeholder).
*/
void func_80128714(void) {
__asm__ __volatile__(
".set noreorder\n"
"addiu $sp, $sp, -24\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"sw $ra, 16($sp)\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_800D19F0\n"
"lui $at, %%hi(D_801E5A14)\n"
"sw $v0, %%lo(D_801E5A14)($at)\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"lui $v0, %%hi(D_801E5A14)\n"
"lw $v0, %%lo(D_801E5A14)($v0)\n"
"bne $v0, $zero, 1f\n"
"jal func_8014607C\n"
"lui $v1, 0x1f80\n"
"ori $v1, $v1, 0x03fc\n"
"addu $t0, $v1, $zero\n"
"sw $sp, 0($t0)\n"
"addiu $t0, $t0, -4\n"
"addu $sp, $t0, $zero\n"
"jal func_801287B8\n"
"addiu $sp, $sp, 4\n"
"lw $sp, 0($sp)\n"
"j 2f\n"
"1:\n"
"jal func_8001903C\n"
"jal func_80018FC8\n"
"2:\n"
"lw $ra, 16($sp)\n"
"addiu $sp, $sp, 24\n"
: : : "memory");
}
// @class: remat
// @stuck: none — MATCH (62 ins). D_801E7AB8 read needed the address REMATERIALIZED
// (lui;addiu;lw 0(reg), not the folded lui;lw %lo) AND pinned to $a0. volatile forces the
// remat; register __asm__("$4") forces the a0 allocation (gcc otherwise picks v0). Both levers
// required — pin-alone folds, volatile-alone lands in v0.
extern s32 D_80126B58;
extern s32 D_801E7AB8;
extern u16 D_800B99DA;
extern u8 D_800B9A64;
extern void func_80129CF8(void);
extern void func_8017849C(void);
extern void func_8014FDF4(struct S8014FDF4 *a0);
extern s32 func_801505FC(s32 a0);
extern void func_801508B4(void *a0);
extern void func_80165E90(void);
extern void func_801627E8(void);
extern void func_80162B1C(void);
extern void func_80165CA0(void);
extern void func_80129010(void);
extern void func_8013CA14(void);
extern void func_800190AC(void);
extern void func_8012956C(void);
extern void func_8016E95C(void);
extern void func_801754A8(void);
extern void func_8013BC7C(void);
extern void func_8013BCDC(void);
extern void func_801379FC(void);
extern void func_8001212C(void);
void func_801287B8(void) {
func_80129CF8();
func_8017849C();
((void (*)(void *))func_8014FDF4)(&D_80126B58);
((void (*)(void *))func_801505FC)(&D_80126B58);
func_801508B4(&D_80126B58);
func_80165E90();
func_801627E8();
func_80162B1C();
func_80165CA0();
func_80129010();
func_8013CA14();
func_800190AC();
func_8012956C();
func_8016E95C();
func_801754A8();
{
/* D_801E7AB8 read: the target materializes &sym into $a0 then lw 0($a0) (not the folded
* lui;lw %lo). volatile forces the rematerialize; the $4 pin forces the a0 allocation. */
register volatile s32 *p __asm__("$4") = &D_801E7AB8;
if (*p == 0) {
func_8013BC7C();
}
}
func_8013BCDC();
func_801379FC();
D_800B99DA++;
if (D_800B9A64 != 0) {
func_8001212C();
}
}
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
extern s32 D_801E4434;
extern u8 D_800AEFD0;
s32 func_801288B0(void) {
func_8001ABBC(0, 0, &D_800AEFD0, D_801E4434, 0);
}
// @class: remat
// @stuck: none — MATCH. &D_800C7C60 CSE'd once via pointer local `p` so the same reg feeds the *p=0x60 store AND arg5; writing D_800C7C60=0x60 directly would emit a 2nd address materialization (+1 ins). Mirrors matched sibling func_80128998.
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AF558;
extern int D_801E4434;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
int func_801288E8(int arg0)
{
int *p = &D_800C7C60;
*p = 0x60;
D_800C7C64 = &D_800A2E20;
((void (*)(int, int, int *, int, int *))func_8001ABBC)(0, 0, &D_800AF558, D_801E4434, p);
}
// @class: remat
// @stuck: none — MATCH (pointer-var forces single materialization of &D_800C7C60, reused as store base + arg5)
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern u8 D_800AF560;
extern s32 D_801E4434;
s32 func_80128940(s32 _arg0)
{
s32 *p = &D_800C7C60;
*p = 0x5E;
D_800C7C64 = &D_800A2E20;
((void (*)(s32, s32, void *, s32, void *))func_8001ABBC)(0, 0, &D_800AF560, D_801E4434, p);
}
// @class: remat
// @stuck: none — MATCH. &D_800C7C60 must be CSE'd once (pointer local `p`) so the same reg feeds the *p=13 store AND arg5; writing D_800C7C60=13 directly emits a 2nd address materialization (+1 ins).
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AECB0;
extern s32 D_801E4434;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
s32 func_80128998(void)
{
int *p = &D_800C7C60;
*p = 13;
D_800C7C64 = &D_800A2E20;
((void (*)(int, int, int *, int, int *))func_8001ABBC)(0, 0, &D_800AECB0, D_801E4434, p);
}
extern s32 D_801E4434;
extern u8 D_800AECB8;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
s32 func_801289F0(void) {
func_8001ABBC(0, 0, &D_800AECB8, D_801E4434, 0);
}
extern void func_80011B7C(int);
extern void func_80011C10(void);
extern u16 D_800B99F6;
extern s16 D_800B9A00;
extern M2C_UNK (*D_8018D1E0)();
extern s16 (*D_8018D1E4)();
void func_80128A28(void) {
s16 temp_v0;
switch (D_800B99F6) { /* irregular */
case 1:
D_8018D1E0();
/* fallthrough */
case 0:
func_80011C10();
return;
case 2:
temp_v0 = D_8018D1E4();
if (temp_v0 != 0) {
if (temp_v0 < 0) {
func_80011B7C(0);
D_800B9A00 = 1;
return;
}
func_80010DE0();
} else {
return;
}
break;
}
}
extern u16 D_800B99F6;
extern M2C_UNK (*D_8018D1EC)();
extern s32 (*D_8018D1F0)();
extern s32 D_801E5A10;
void func_80128AF4(void) {
switch (D_800B99F6) { /* irregular */
case 0:
D_801E5A10 = func_8002AF08();
func_80011C10();
return;
case 1:
D_8018D1EC();
func_80011C10();
return;
case 2:
if ((D_8018D1F0() << 0x10) != 0) {
if (D_801E5A10 == 1) {
if (func_800CFBE8() != 0) {
func_800CFBBC();
func_80011B7C(0x13);
} else {
func_80011B7C(4);
}
} else {
func_80010DE0();
}
func_8002AEF8();
}
return;
}
}
DEFINE_func_80128C14() /* dedup: shared engine-core @0x80128C14 (src/shared) */
extern CdFileLoc_80128C98 cdFileLocTable[];
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
s32 func_80128C98(s32 arg0) {
extern s16 D_8018D4C4[];
s16 idx = D_8018D4C4[arg0];
if (idx >= 0) {
func_8001ABBC(0, 0, (u8 *)&cdFileLocTable[idx], D_801E4434, 0);
} else {
return 1;
}
}
extern CdFileLoc cdFileLocTable[];
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
s32 func_80128CFC(s32 arg0) {
extern s16 D_8018D4D4[];
s16 idx = D_8018D4D4[arg0];
if (idx >= 0) {
func_8001ABBC(0, 0, (u8 *)&cdFileLocTable[idx], D_801E4434, 0);
} else {
return 1;
}
}
DEFINE_func_80128D60() /* dedup: shared engine-core @0x80128D60 (src/shared) */
DEFINE_func_80128DB4() /* dedup: shared engine-core @0x80128DB4 (src/shared) */
DEFINE_func_80128EA8() /* dedup: shared engine-core @0x80128EA8 (src/shared) */
DEFINE_func_80128ED8() /* dedup: shared engine-core @0x80128ED8 (src/shared) */
extern M2C_UNK D_801E4438;
void func_80128FAC(u16 *arg0) {
func_8001534C(4, &D_801E4438, 0x80, 0x90, 0, 0);
func_800153CC(5, *arg0, 0xA8, 0x90, 0x40, 0);
}
DEFINE_func_80129010() /* dedup: shared engine-core @0x80129010 (src/shared) */
DEFINE_func_801290DC() /* dedup: shared engine-core @0x801290DC (src/shared) */
DEFINE_func_8012913C() /* dedup: shared engine-core @0x8012913C (src/shared) */
DEFINE_func_801291C0() /* dedup: shared engine-core @0x801291C0 (src/shared) */
DEFINE_func_80129220() /* dedup: shared engine-core @0x80129220 (src/shared) */
DEFINE_func_80129248() /* dedup: shared engine-core @0x80129248 (src/shared) */
DEFINE_func_80129258() /* dedup: shared engine-core @0x80129258 (src/shared) */
DEFINE_func_8012927C() /* dedup: shared engine-core @0x8012927C (src/shared) */
DEFINE_func_801292C8() /* dedup: shared engine-core @0x801292C8 (src/shared) */
DEFINE_func_8012931C() /* dedup: shared engine-core @0x8012931C (src/shared) */
DEFINE_func_80129350() /* dedup: shared engine-core @0x80129350 (src/shared) */
DEFINE_func_80129374() /* dedup: shared engine-core @0x80129374 (src/shared) */
DEFINE_func_80129398() /* dedup: shared engine-core @0x80129398 (src/shared) */
DEFINE_func_80129428() /* dedup: shared engine-core @0x80129428 (src/shared) */
DEFINE_func_8012943C() /* dedup: shared engine-core @0x8012943C (src/shared) */
DEFINE_func_8012944C() /* dedup: shared engine-core @0x8012944C (src/shared) */
extern s32 D_801E5A14;
extern void func_801299C8();
extern void func_80015B6C(s32, s16, s32, s16, s32, s32, s32, s32, s32, s32);
extern void GsSortBg(s32 *, void *, u16, s32 *);
extern void GsSortFastBg(s32 *, void *, u16, s32 *);
void func_8012956C(void) {
extern s16 D_80114EE0;
extern u8 D_800B9A78;
extern u8 D_801E5A15[];
extern u8 D_801E5A16[];
extern u8 D_801E5A18[];
extern u8 D_801E5A19[];
extern u8 D_801E5A1A[];
extern u8 D_801E7A80;
extern u8 D_800AF630[];
extern u8 D_800A6518[];
register s32 *sp10 __asm__("$21");
register u8 *afbase __asm__("$22");
register s32 *sp0 __asm__("$23");
Ent_956C *base;
s32 i;
s16 a1;
register u32 temp_a3 __asm__("$7");
register u32 arg0 __asm__("$4");
register u32 s __asm__("$2");
register u32 s2 __asm__("$3");
register u32 t6 __asm__("$8");
s32 code;
sp10 = (s32 *)0x1F800010;
sp0 = (s32 *)0x1F800000;
afbase = (u8 *)&D_800AF630;
if (D_80114EE0 == 0) {
return;
}
base = (Ent_956C *)&D_800B9A78;
__asm__("" : "=r"(base) : "0"(base));
i = 0;
do {
s32 idx = i * 8 + 4;
code = base->f34;
if (code == 0x7FFE) {
goto case_7FFE;
}
if (code < 0x7FFF) {
a1 = i + 3;
if (code == 0x7FFD) {
goto case_7FFD;
}
goto do_default;
}
a1 = i + 3;
if (code != 0x7FFF) {
goto do_default;
}
goto next;
case_7FFD:
if (i == 0) {
func_801299C8(D_801E7A80, 1, base);
}
func_80015B6C(-0xA0, -0x74, 0x140, 0x8C,
D_801E5A18[0], D_801E5A18[1], D_801E5A18[2],
D_801E5A18[4], D_801E5A18[5], D_801E5A18[6]);
func_80015B6C(-0xA0, 0x18, 0x140, 0x3C,
D_801E5A18[4], D_801E5A18[5], D_801E5A18[6],
D_801E5A18[8], D_801E5A18[9], D_801E5A18[0xA]);
func_80015B6C(-0xA0, 0x54, 0x140, 0x28,
D_801E5A18[8], D_801E5A18[9], D_801E5A18[0xA],
D_801E5A18[0xC], D_801E5A18[0xD], D_801E5A18[0xE]);
goto next;
case_7FFE:
func_801299C8(D_801E7A80, (s16)(i * 2), base);
func_80015B6C(-0xA0, *(s16 *)&base->f3A, 0x140, base->f3E,
((u8 *)&D_801E5A14)[idx], D_801E5A15[idx], D_801E5A16[idx],
D_801E5A18[idx], D_801E5A19[idx], D_801E5A1A[idx]);
goto next;
do_default:
__asm__("");
arg0 = D_801E7A80;
s = base->f40;
temp_a3 = base->f38;
s += temp_a3;
base->f1C = s;
s2 = base->f42;
t6 = base->f3A;
s2 += t6;
base->f1E = s2;
((void (*)(s32, s32, void *, s32))func_801299C8)(arg0, a1, base, temp_a3);
*(Blk16_956C *)sp0 = *(Blk16_956C *)base;
{
s32 *dst = sp10;
s32 *src = (s32 *)((u8 *)base + 0x10);
s32 *end = (s32 *)((u8 *)base + 0x30);
do {
*(Blk16_956C *)dst = *(Blk16_956C *)src;
src += 4;
dst += 4;
} while (src != end);
*dst = *src;
sp10[5] = (s32)sp0;
if (base->f36 == 0) {
GsSortFastBg(sp10, &D_800A6518[(*(u16 *)(afbase + 0xA3D2)) * 0x14], base->f34, dst);
} else {
GsSortBg(sp10, &D_800A6518[(*(u16 *)(afbase + 0xA3D2)) * 0x14], base->f34, dst);
}
}
next:
base += 1;
i += 1;
} while (i < 2);
}
DEFINE_func_801298F4() /* dedup: shared engine-core @0x801298F4 (src/shared) */
// @class: schedule
// @stuck: none — MATCH (158 ins, match_one relocation-masked)
//
// Levers that landed it (2 iterations, 56 mismatched -> MATCH):
// 1. §43 K&R s16-param definition: `void f(a0,a1,a2) s16 a0; s16 a1; u8 *a2;` reproduces the
// in-place `sll $a0,$a0,16` zero-test on the arg reg + the raw-$a1 copy (`addu $a3,$a1,$zero`)
// stashed in the jtbl branch delay slot and RE-extended per use in the case body.
// 2. §18 array-of-struct %lo-fold: three sibling extern arrays D_801E5A18/1/2[] (a 4-row x 3-comp
// RGB gradient table, stride 4) give `lui $at,%hi(sym); addu $at,$at,idx4; sb $v0,%lo(sym)($at)`
// for the indexed case and plain `lui/sb %lo(sym+k)` for the constant-index case.
// 3. Switch CASE-ORDER = source order: the jump table dispatches case 1 to the FIRST emitted block,
// so `case 1:` must be written before `case 0/2:` and `case 3/4:`.
// 4. THE residual (56 -> 0): the case-1 body must be written ROW-MAJOR (BE0[0],BE1[0],BE2[0],
// BE0[4],BE1[4],BE2[4],...), i.e. the natural table fill. gcc-2.7.2's sched pass then REORDERS
// the stores itself (BE0,BE1,BE5,BE8,BE4,BEC,BE9,BED,BE2,BE6,BEA,BEE) because the three arrays
// are distinct declarations => provably non-aliasing. Writing the source in the target's STORE
// order is the trap: it pins the b*255 / r*143 CSEs at their late store sites instead of letting
// them hoist into $a0/$v1 at rows 0/1, and mis-schedules the D_801E7988 load.
// 5. Shift signedness: `u32` component locals give `srl` for r*5>>3 and g*25>>1; an explicit
// `(s32)(x * 255) >> 4` gives `sra` for the *255 / *143 / *45 terms (mixed within one block).
extern u8 D_801E7AB2;
extern u8 D_801E79B2;
extern u8 D_801E7988;
extern u8 D_801E5A18[];
extern u8 D_801E5A19[];
extern u8 D_801E5A1A[];
void func_801299C8(arg0, arg1, arg2)
s16 arg0;
s16 arg1;
u8 *arg2;
{
u32 r;
u32 g;
u32 b;
s32 i;
if (arg0 != 0) {
switch (arg1) {
case 1:
r = D_801E7AB2;
g = D_801E79B2;
b = D_801E7988;
D_801E5A18[0] = r * 5 >> 3;
D_801E5A19[0] = g << 3;
D_801E5A1A[0] = (s32)(b * 255) >> 4;
D_801E5A18[4] = (s32)(r * 143) >> 4;
D_801E5A19[4] = g * 25 >> 1;
D_801E5A1A[4] = (s32)(b * 255) >> 4;
D_801E5A18[8] = (s32)(r * 255) >> 4;
D_801E5A19[8] = (s32)(g * 255) >> 4;
D_801E5A1A[8] = (s32)(b * 255) >> 4;
D_801E5A18[12] = (s32)(r * 143) >> 4;
D_801E5A19[12] = (s32)(g * 255) >> 4;
D_801E5A1A[12] = (s32)(b * 45) >> 2;
break;
case 0:
case 2:
i = arg1 * 4;
D_801E5A18[i] = arg2[0x44] * D_801E7AB2 >> 4;
D_801E5A19[i] = arg2[0x45] * D_801E79B2 >> 4;
D_801E5A1A[i] = arg2[0x46] * D_801E7988 >> 4;
i = (arg1 + 1) * 4;
D_801E5A18[i] = arg2[0x47] * D_801E7AB2 >> 4;
D_801E5A19[i] = arg2[0x48] * D_801E79B2 >> 4;
D_801E5A1A[i] = arg2[0x49] * D_801E7988 >> 4;
break;
case 3:
case 4:
arg2[0x20] = D_801E7AB2 << 3;
arg2[0x21] = D_801E79B2 << 3;
arg2[0x22] = D_801E7988 << 3;
break;
}
}
}
DEFINE_func_80129C40() /* dedup: shared engine-core @0x80129C40 (src/shared) */
DEFINE_func_80129CF8() /* dedup: shared engine-core @0x80129CF8 (src/shared) */
DEFINE_func_80129FF4() /* dedup: shared engine-core @0x80129FF4 (src/shared) */
DEFINE_func_8012A018() /* dedup: shared engine-core @0x8012A018 (src/shared) */
DEFINE_func_8012A048() /* dedup: shared engine-core @0x8012A048 (src/shared) */
DEFINE_func_8012A094() /* dedup: shared engine-core @0x8012A094 (src/shared) */
DEFINE_func_8012A0E0() /* dedup: shared engine-core @0x8012A0E0 (src/shared) */
DEFINE_func_8012A100() /* dedup: shared engine-core @0x8012A100 (src/shared) */
DEFINE_func_8012A110() /* dedup: shared engine-core @0x8012A110 (src/shared) */
// @class: regalloc-order
// @stuck: none — MATCH (78 ins, relocation-masked). Register pins ($2-$5 reused for
// the D_x200-x20C words then the D_x220-x226 halfwords; $6-$10 held across for the
// D_x228/x22A/x294/x298/x29A tail) force the frameless 9-deep allocation the default
// -O2 pre-reload scheduler otherwise blows to a 3-reg spill (all 720 stmt orders spill
// without the pins). A single zero-byte scheduling/memory barrier after the 4 word
// stores stops gcc hoisting the first 8-byte block copy above them.
DEFINE_func_8012A1BC() /* dedup: shared engine-core @0x8012A1BC (src/shared) */
DEFINE_func_8012A2F4() /* dedup: shared engine-core @0x8012A2F4 (src/shared) */
DEFINE_func_8012A304() /* dedup: shared engine-core @0x8012A304 (src/shared) */
DEFINE_func_8012A328() /* dedup: shared engine-core @0x8012A328 (src/shared) */
DEFINE_func_8012A418() /* dedup: shared engine-core @0x8012A418 (src/shared) */
DEFINE_func_8012A464() /* dedup: shared engine-core @0x8012A464 (src/shared) */
DEFINE_func_8012A4BC() /* dedup: shared engine-core @0x8012A4BC (src/shared) */
DEFINE_func_8012A568() /* dedup: shared engine-core @0x8012A568 (src/shared) */
DEFINE_func_8012A598() /* dedup: shared engine-core @0x8012A598 (src/shared) */
DEFINE_func_8012A5F8() /* dedup: shared engine-core @0x8012A5F8 (src/shared) */
DEFINE_func_8012A62C() /* dedup: shared engine-core @0x8012A62C (src/shared) */
DEFINE_func_8012A68C() /* dedup: shared engine-core @0x8012A68C (src/shared) */
DEFINE_func_8012A6D0() /* dedup: shared engine-core @0x8012A6D0 (src/shared) */
DEFINE_func_8012A758() /* dedup: shared engine-core @0x8012A758 (src/shared) */
DEFINE_func_8012A79C() /* dedup: shared engine-core @0x8012A79C (src/shared) */
DEFINE_func_8012A7D4() /* dedup: shared engine-core @0x8012A7D4 (src/shared) */
DEFINE_func_8012A828() /* dedup: shared engine-core @0x8012A828 (src/shared) */
DEFINE_func_8012A860() /* dedup: shared engine-core @0x8012A860 (src/shared) */
DEFINE_func_8012A8B0() /* dedup: shared engine-core @0x8012A8B0 (src/shared) */
DEFINE_func_8012A8E8() /* dedup: shared engine-core @0x8012A8E8 (src/shared) */
DEFINE_func_8012A908() /* dedup: shared engine-core @0x8012A908 (src/shared) */
DEFINE_func_8012A988() /* dedup: shared engine-core @0x8012A988 (src/shared) */
extern void func_8012AAAC(void *arg0);
void func_8012AAAC(void *arg0) {
void *ptr;
s32 link;
s32 next;
s32 saved;
s32 cnt;
s32 back;
s32 head;
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) & 0xBFFF);
ptr = (void *) (M2C_FIELD(arg0, s32 *, 0x90) + (M2C_FIELD(arg0, s32 *, 0x94) * 8));
if (M2C_FIELD(ptr, s16 *, 4) < 0) {
switch (M2C_FIELD(ptr, s16 *, 4)) {
case -2:
link = M2C_FIELD(arg0, s32 *, 0x9C);
if (link == 0) {
M2C_FIELD(arg0, s16 *, 0x98) = 0;
break;
}
goto pop;
case -1:
link = M2C_FIELD(arg0, s32 *, 0x9C);
if (link != 0) {
pop:
back = M2C_FIELD(arg0, s16 *, 0x9A);
M2C_FIELD(arg0, s32 *, 0x90) = link;
M2C_FIELD(arg0, s32 *, 0x9C) = 0;
M2C_FIELD(arg0, s16 *, 0x9A) = 0;
M2C_FIELD(arg0, s32 *, 0x94) = back;
func_8012AAAC(arg0);
break;
}
M2C_FIELD(arg0, s32 *, 0x94) = 0;
func_8012AAAC(arg0);
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) | 0x4000);
break;
case -4:
head = M2C_FIELD(ptr, s32 *, 0);
M2C_FIELD(arg0, s32 *, 0x94) = 0;
M2C_FIELD(arg0, s32 *, 0x9C) = 0;
M2C_FIELD(arg0, s16 *, 0x9A) = 0;
M2C_FIELD(arg0, s32 *, 0x90) = head;
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) & 0xF9FF);
func_8012AAAC(arg0);
break;
case -3:
cnt = M2C_FIELD(arg0, s32 *, 0x94) + 1;
M2C_FIELD(arg0, s32 *, 0x94) = cnt;
if (M2C_FIELD(arg0, s32 *, 0x9C) != 0) {
func_8012AAAC(arg0);
break;
}
saved = M2C_FIELD(arg0, s32 *, 0x90);
next = M2C_FIELD(ptr, s32 *, 0);
M2C_FIELD(arg0, s32 *, 0x94) = 0;
M2C_FIELD(arg0, s32 *, 0x9C) = 0;
M2C_FIELD(arg0, s16 *, 0x9A) = 0;
M2C_FIELD(arg0, s32 *, 0x90) = next;
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) & 0xF9FF);
func_8012AAAC(arg0);
M2C_FIELD(arg0, s32 *, 0x9C) = saved;
M2C_FIELD(arg0, s16 *, 0x9A) = (s16) cnt;
break;
case -50:
M2C_FIELD(arg0, s32 *, 0x94) = M2C_FIELD(arg0, s32 *, 0x94) + 1;
func_8012AAAC(arg0);
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) | 0x2000);
break;
case -5:
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) | 0x400);
M2C_FIELD(arg0, s32 *, 0x94) = M2C_FIELD(arg0, s32 *, 0x94) - 1;
func_8012AAAC(arg0);
break;
}
} else {
M2C_FIELD(M2C_FIELD(arg0, void **, 0x20), s32 *, 0x20) = M2C_FIELD(ptr, s32 *, 0);
M2C_FIELD(arg0, s16 *, 0x98) = M2C_FIELD(ptr, s16 *, 4);
}
}
extern void func_8012AAAC();
extern M2C_UNK D_8018D540;
void func_8012ACA0(void *arg0) {
M2C_FIELD(arg0, M2C_UNK **, 0x90) = &D_8018D540;
M2C_FIELD(arg0, s32 *, 0x94) = 0;
M2C_FIELD(arg0, s32 *, 0x9C) = 0;
M2C_FIELD(arg0, s16 *, 0x9A) = 0;
M2C_FIELD(arg0, u16 *, 0x72) = (u16) (M2C_FIELD(arg0, u16 *, 0x72) & 0xF9FF);
((void (*)(void))func_8012AAAC)();
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-709
View File
@@ -1,709 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
extern void func_80128288(void);
extern void func_80128158(void);
extern void func_801285E4(void);
extern void func_80128178(void);
extern void func_80128678(void);
extern void func_80128198(void);
extern void func_80128714(void);
extern void func_801281B8(void);
extern void func_8013E67C(void);
extern void func_801281D8(void);
extern void func_8013E558(void);
extern void func_801281F8(void);
extern s32 D_801E4434;
extern s32 func_80128218(void);
extern void func_80128A28(void);
extern void func_80128228(void);
extern void func_80128AF4(void);
extern void func_80128248(void);
extern void func_801282EC(void);
extern void func_80128268(void);
extern u16 D_800B99F6;
extern void (*D_8018D4AC[])(void);
extern void func_80011B7C(int);
extern void func_801282CC(void);
extern void func_8001C0C8(void);
extern void func_80015310(void);
extern void func_80129258(void);
extern void func_801378F0(void);
extern void func_80010E14(void);
extern s16 currentLocationId;
extern s32 func_80029504(void);
extern s32 func_800CF854(s32);
extern s32 func_80128998(void);
extern s32 func_801289F0(void);
extern s32 func_801288E8(s32);
extern s32 func_80128940(s32);
extern s32 func_80029178(s32);
extern s32 func_801288B0(void);
extern void func_80011C10(void);
extern void func_8012832C(void);
extern void func_80129220(void);
extern void func_80011E24(void);
extern void func_80128C14(void);
extern void func_8002AEF8(void);
extern void func_800CFBBC(void);
extern void SsUtReverbOff(void);
extern void func_8013C98C(void);
extern void func_80129C40(s32 a0);
extern void func_800D0630(void);
extern void func_80145CEC(void);
extern void func_80144B9C(void);
extern u8 D_800B9A17;
extern u8 D_800B9A10;
extern void func_80128420(void);
extern s32 func_800D0588(void);
extern void func_801284B8(void);
extern void func_80175308(void);
extern void func_8016E8F0(void);
extern void func_80175494(void);
extern u8 D_800B9A64;
extern void func_801284F0(void);
extern void func_80146074(void);
extern void func_8012853C(void);
extern void func_80178608(void);
extern void func_8002D4C8(s32 a0, s32 a1);
extern s32 func_80011A3C(void);
extern short currentLocationId;
extern short D_800B99F2;
extern void func_80128564(void);
extern u8 D_800B9A11;
extern void func_801285D4(void);
extern s32 func_800D18DC(void);
extern void func_8014607C(void);
extern void func_801287B8(void);
extern s32 D_801E5A14;
extern void func_80029444(void);
extern void func_800D1754(void);
extern s32 D_80126B58;
extern s32 D_801E7AB8;
extern u16 D_800B99DA;
extern void func_80129CF8(void);
extern void func_8017849C(void);
extern void func_8014FDF4(struct S8014FDF4 *a0);
extern s32 func_801505FC(s32 a0);
extern void func_801508B4(void *a0);
extern void func_80165E90(void);
extern void func_801627E8(void);
extern void func_80162B1C(void);
extern void func_80165CA0(void);
extern void func_80129010(void);
extern void func_8013CA14(void);
extern void func_800190AC(void);
extern void func_8012956C(void);
extern void func_8016E95C(void);
extern void func_801754A8(void);
extern void func_8013BC7C(void);
extern void func_8013BCDC(void);
extern void func_801379FC(void);
extern void func_8001212C(void);
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
extern u8 D_800AEFD0;
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AF558;
extern int D_801E4434;
extern int func_801288E8(int arg0);
extern u8 D_800AF560;
extern s32 func_80128940(s32 _arg0);
extern int D_800AECB0;
extern u8 D_800AECB8;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
extern s16 D_800B9A00;
extern M2C_UNK (*D_8018D1E0)();
extern s16 (*D_8018D1E4)();
extern M2C_UNK (*D_8018D1EC)();
extern s32 (*D_8018D1F0)();
extern s32 D_801E5A10;
extern void func_80010AE0(s32 a0);
extern void func_80018450(s32 a0, s32 a1);
extern void func_800183E0(s32 a0);
extern void func_80128D60(s32 a0, s32 *a1, s32 *a2);
extern s32 func_80128DB4(s32 a0, s32 *a1);
extern void func_80128EA8(s32 a0, s32 a1, s32 a2);
extern M2C_UNK D_801E4438;
extern void func_80128FAC(u16 *arg0);
extern s16 D_8011DB2C;
extern s16 D_8011DB30;
extern s32 D_80126AEC;
extern u8 *func_8012913C(s32 a0);
extern u8 * func_801290DC(s32 a0, u8 *a1);
extern void func_8001D074(s32 a, s32 b);
extern u8 *func_801291C0(void);
extern s32 func_8001CC3C(s32 a0, s32 a1, s32 a2, s32 a3);
extern u8 * func_8012913C(s32 arg0);
extern void func_80016714(void *a0, s32 a1);
extern u8 * func_801291C0(void);
extern void func_80129248(s16 a0);
extern void func_801292C8(u8 *a0);
extern void func_8012927C(void);
extern void func_8012931C(struct vec *a0);
extern void func_80129350(s32 a0, s32 a1);
extern void func_80129374(s32 a0, s32 a1);
extern s16 D_800B9AAC[];
extern s16 D_800B9AAE[];
extern s16 D_800B9AB0[];
extern s16 D_800B9AB2[];
extern s16 D_800B9AB4[];
extern s16 D_800B9AB6[];
extern s16 D_800B9AB8[];
extern s16 D_800B9ABA[];
extern void func_80129398(void);
extern s16 D_80114EE0;
extern void func_80129428(void);
extern void func_8012943C(void);
extern s32 D_8005128C;
extern u8 D_800B9A78;
extern void func_801298F4(void *arg0);
extern void func_801299C8(s32 a, s32 b, s32 c);
extern void func_8012944C(void);
extern unsigned short D_800B99F0;
extern void func_8012A328(void);
extern void func_80053308(s32);
extern s32 func_80012F74(s32, s32, s32, s32); /* canonical s32 (engine_core); (s16)-cast the return for the sll/sra */
extern void GsSetRefView2L(void *);
extern s8 D_801150D6; /* canonical (engine_core macro): s8 — access via *(u8*)& for lbu */
extern u8 D_80127504;
extern s32 D_80126E60[];
extern s32 D_80126F04[];
extern u8 D_80126948[]; /* canonical (sibling): u8[] — cast (s32*) at use */
extern s32 D_80126FA8[];
extern struct BigCopy D_80126DB8;/* canonical (engine_core macro): struct BigCopy — (s32*)& at use */
extern u8 D_800AF630[]; /* canonical (sibling): u8[] — cast (s32*) at use */
extern s32 D_800AE688[];
extern s32 D_801151D4; /* canonical (10 siblings): scalar s32 — store (s32)ptr */
extern void func_8012A018(s32 a, s32 b);
extern void func_80129FF4(void);
extern u16 D_80126B5E;
extern u16 D_80126B62;
extern u16 D_80126B66;
extern s16 D_80126940;
extern s16 D_80126942;
extern s16 D_80126944;
extern void func_8012A048(void *a0, s32 a1, u8 a2);
extern void *memcpy(void *, const void *, unsigned int);
extern void func_8012A094(s32 a0);
extern void func_8012A100(s8 a0);
extern void func_8012A0E0(void);
extern s8 D_801150D6;
extern s32 D_80120204;
extern s32 D_80120200;
extern s32 D_8012020C;
extern s32 D_80120208;
extern s16 D_80120218;
extern s16 D_80120210;
extern s16 D_8012021A;
extern s16 D_80120212;
extern s16 D_8012021C;
extern s16 D_80120214;
extern s16 D_80120226;
extern s16 D_80120220;
extern s16 D_80120228;
extern s16 D_80120222;
extern s16 D_8012022A;
extern s16 D_80120224;
extern s32 D_80120294;
extern s16 D_80120298;
extern s16 D_8012029A;
extern void func_8012A110(void);
extern s8 D_801152C0;
extern void func_8012A2F4(void);
extern s16 D_80127080;
extern s16 D_801152C2;
extern void func_8012A304(s32 a0, s32 a1);
extern s32 D_801151D4;
extern struct BigCopy D_80126DB8;
extern struct BigCopy D_80114EE8;
extern void func_8012A4BC(void);
extern void func_8012A598(void *a0);
extern void func_8012A568(void (*a0)(void));
extern void func_8012A62C(s32);
extern void func_8012A5F8(void (*a0)(void), s32 a1);
extern void func_8012A62C(s32 a0);
extern void func_8012A7D4(void *a0, void *a1);
extern s32 func_8012A6D0(void *a0, void *a1);
extern s16 func_8012A68C(void);
extern s16 func_8012A79C(s16 *a0, s16 *a1);
extern s16 func_8012A758(void);
extern s32 ratan2(s32 a0, s32 a1);
extern void func_8012A7D4(void *arg0, void *arg1);
extern void func_8012AAAC();
extern void func_8012A828(s32 a0, void * a1);
extern int func_8012ACE0(void *a0);
extern void func_8012A860(void *a0, int a1);
extern void func_8012A8B0(u8 *a0, s32 a1);
extern void func_8012A8E8(void);
extern u8 D_801202A0[];
extern u16 D_801270C0;
extern void func_8012A988(u8 *a0);
extern void func_8012A908(void);
extern s32 func_8012ACE0(void *a0);
extern M2C_UNK D_8018D540;
extern void func_8012ACA0(void *arg0);
extern s32 func_8012ACE0(void *o);
extern void func_8012AD44(s32 *a0, s16 a1);
extern s32 func_8012AD50(void * arg0);
extern void func_8012AD64(s32 *a0, s16 a1);
extern void func_8012AD6C(void *a0);
extern void func_8012AD80(s32 a0);
extern void func_8012ADE4(u8 *a0);
extern s32 *D_80126B78;
extern s32 *D_80126B90;
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
extern s32 func_80013478(s32 a0, s32 a1);
extern s32 func_8012AE00(s32 a0);
extern s32 func_8012AF0C(s32 a0, s32 a1);
extern s32 func_80134510(s32 arg);
extern s32 func_8012B030(u8 *a0);
extern int func_80047948(int a0);
extern int func_8004787C(int a0);
extern void func_8012B0B4(unsigned int *param_1, int param_2, int param_3);
extern void func_800484EC(s32 a0, s32 a1, s32 a2);
extern void func_8012B14C(s32 a0, s32 a1);
extern void func_8012B178(s32 a0, s32 a1);
extern void func_8012B1B4(s32 a0, s32 a1);
extern void func_8012B200(u8 *a0);
extern void func_8012B21C(void *a0);
extern void func_8012B23C(s32 a0);
extern void func_8012B260(u8 *a0);
extern void func_80049CAC(s32 a0, s32 a1);
extern void func_8012B2CC(s32 a0);
extern void RotMatrixYXZ(void *m, void *p);
extern void func_8012B370(int a0);
extern void func_8004978C(s16 *a0, void *a1);
extern void func_8012B414(int a0);
extern s32 func_8012B608(s32 a0, s32 a1, s32 a2);
extern s32 func_8012B6D4(s16 *a0, s16 *a1);
extern s32 func_8012B70C(s16 *a0, s16 *a1);
extern s32 ratan2(s32 x, s32 y);
extern s32 func_8012B744(void *a0, void *a1);
extern s16 D_80126CB8;
extern s16 D_80126CB4;
extern s32 func_8012B864(s32 a0);
extern s32 func_8012B8A4(s16 *a0);
extern s32 func_8012B8E4(s32 arg0, s32 arg1);
extern s32 func_8012BA10(s32 arg0, s32 arg1);
extern s32 func_8012BB3C(s32 arg0, s32 arg1, u32 arg2, s32 arg3);
extern void Square0(s32 *a0, s32 *a1);
extern s32 func_8012BC60(struct Vec *a0, struct Vec *a1);
extern s16 D_80126CBA;
extern s32 func_8012BCCC(s32 a0);
extern void func_80013350(s32 a0, void *a1);
extern u8 D_80126B5C;
extern void func_8012BD14(s32 a0);
extern s32 func_8012BDBC(s32 a0, s32 a1);
extern s32 func_8012BD3C(s32 a0, s32 a1, s32 a2);
extern void func_8012BE98(s32 a0, u16 *a1);
extern void func_8012BE54(s32 a0);
extern s32 func_800132BC(s32 a0, s32 a1);
extern void func_8012BE98(s32 arg0, u16 * arg1);
extern s32 func_8012BEE8(s32 a0);
extern s32 func_8012BF10(s32 a0, s32 a1);
extern void func_8012BF4C(s32 *a0, s32 a1);
extern void func_8012BF54(void *a0);
extern void func_8012BF68(void *a0);
extern s16 D_80126CB0;
extern s32 func_8012BF7C(s16 *a0);
extern s16 D_80126CAC;
extern short D_80126CAE;
extern int func_8012BFA8(short *a0);
extern s32 D_801274D4;
extern s32 D_801274E0;
extern s32 func_8012C044(s32 a0);
extern void func_8012C218(void *a0);
extern void func_8012C098(void *param_1);
extern s32 func_8012C0EC(s32 a0);
extern void func_8012C194(void);
extern void func_8001CFDC(s32 a, s32 b);
extern void func_8012C1B8(void);
extern u8 D_800B3DF0[];
extern s32 func_8012C1DC(s32 a0);
extern u8 D_80126720[];
extern u16 * func_8012C284(u16 *a0);
extern u8 D_80120194[];
extern s32 func_8012C2D0(void);
extern s32 func_8012C31C(void);
extern void func_8012CAE4(void *a0);
extern void func_8001C214(s32 a0, s32 a1);
extern u8 D_80078EAE;
extern s32 func_8012C354(s32 a0, s32 a1);
extern void func_8001C810(s32 a0, s32 a1);
extern s32 func_8012C438(s32 a0, s32 a1);
extern s32 func_8012C890(s32 a0, s32 a1, s32 a2);
extern s32 func_8012C51C(void *a0, s32 a1);
extern s32 func_8012C588(s32 a0, s32 a1);
extern void func_8012C724(s32 a0, s32 a1);
extern s32 func_8012C750(s32 a0);
extern s32 func_8012C820(u8 *a0);
extern s32 D_80190A24;
extern s16 D_801270C4;
extern u16 D_801274E4[];
extern s32 D_8011DB08;
extern s32 func_8012CB64(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
extern s32 func_8012CC88(s32 a, s32 b, s32 c);
extern u8 D_800D3918[];
extern void func_8012CBA4(s32 a0);
extern void func_8012CBCC(s32 a0);
extern void func_8012CBF4(s32 a0);
extern void func_8012CC1C(s32 arg0, s32 arg1);
extern void func_8012CC40(s32 arg0, s32 arg1);
extern s32 func_8012CC88(s32 a0, s32 a1, s32 a2);
extern void func_8012CC64(s32 a0, s32 a1);
extern s32 func_80133784(s32 a0, void *a1, s32 a2);
extern s32 func_8012CE2C(s32 a0);
extern s32 func_8012CEB0(s32 a0, s32 a1, s32 a2);
extern void func_8012CFA8(s32 arg0);
extern void func_8012F214(s32 a0, s32 a1, s32 a2);
extern void func_8012D3B4(s32 arg0, s32 arg1, s32 arg2);
extern void func_8012D098(u16 *param_1, u32 param_2);
extern void func_8012D098();
extern void func_8012D38C(int a0);
extern void func_8012D3AC(void);
extern s32 AddPrim(s32, void *);
extern s32 RotTransPers(s32, s32, s32 *, s32 *);
extern void SetLineF2(void *);
extern void *func_80010A08(s32);
extern void func_8004914C(void *);
extern void func_800491AC(void *);
extern s32 D_800A651C;
extern u8 D_800AF648;
extern s16 D_800B9A02;
extern void func_8012D4B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern void func_8012D5DC(void);
extern s16 D_80126B98;
extern s32 func_8012DEB8(s32 a0, s32 a1, s32 a2);
extern s32 func_8012D5E4(s32 a0, s32 a1, s32 a2, s32 a3);
extern int func_8012D664();
extern void func_8012D624(s32 a0);
extern int func_8012D664(int arg0, int arg1, int arg2);
extern s32 func_8012D714(s32 param_1, u32 param_2);
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
extern void func_8014C978(void);
extern M2C_UNK D_8018D558;
extern M2C_UNK D_8018D560;
extern s32 func_8012DB84(void);
extern s32 func_8012DE2C(s32 a0);
extern s32 func_8012DDA4(void);
extern s32 func_8012DBD0(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_8012DDA4();
extern s32 func_8012DF34(s32 a0, s32 a1, s32 a2);
extern s16 D_80126B9A;
extern u8 D_801152A8[];
extern void func_8012DFBC(void);
extern void func_8012DFCC(void);
extern void func_8012E014(s32 arg0);
extern void func_8012E138(void);
extern void func_8012DFD4(u8 *a0);
extern s32 func_8012E27C(void);
extern void func_8012E284(void);
extern s32 GetTPage(s32, s32, s32, s32);
extern s32 func_8005A600(s32, s32, s32, s32, s32);
extern void func_8012E28C(s32 arg0, s32 arg1);
extern void func_8004914C(void *a0);
extern void func_800491AC(void *a0);
extern void func_8012E32C(void);
extern s32 func_8012E470(s32 a0);
extern void func_8012E4C8(s32 a0);
extern s32 func_8012E504(s32 a0, s32 a1);
extern s32 func_8012E544(s32 a0);
extern s32 func_8012E57C(s32 a0, s32 a1);
extern s32 RotTransPers(s32 a0, s32 a1, s32 *a2, s32 *a3);
extern void func_8012E5CC(s32 param_1, u16 param_2, u16 param_3);
extern void func_8012E688(s32 param_1, u16 param_2, u16 param_3);
extern s32 func_8012E778(int param_1, int param_2);
extern void func_8012E88C(u8 *a0);
extern void func_8012E8A8(u8 *a0);
extern void func_8012E8C4(u8 *a0);
extern void func_8012E8E0(s32 a0, s32 a1);
extern void func_8016AA50(int, int);
extern void func_8016B428(int);
extern void func_80019064(void *);
extern int D_8018D568;
extern void func_8012E9C0(int param_1);
extern void func_8012EA90(s32 param_1, s32 param_2, s32 *param_3);
extern void func_8012EC04(s32 param_1, s32 param_2, s32 *param_3);
extern s32 func_8002A4FC(s32 a0);
extern s32 func_8012EECC(s32 a0);
extern void func_8012EFB8(s32 a0);
extern void func_8012EF34(s32 a0, s32 a1);
extern void func_8012EF70(s32 a0, s32 a1);
extern void ApplyTransposeMatrixLV(void *a0, void *a1, void *a2);
extern void func_8012F038(int param_1, short *param_2, short *param_3);
extern void func_8012F0BC(s32 *a0, s32 *a1, s32 *a2);
extern void RotTransSV(s32 a0, s32 a1, void *a2);
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
extern void func_8012F1A4(s32 *a0, s32 a1, s32 *a2);
extern void func_8012F2E8(s32 a0, s32 a1, s32 a2);
extern s16 D_80126CB6;
extern void func_8012F374(s32 a0, s32 a1);
extern void *memcpy(void *, const void *, u32);
extern u8 D_80126C38;
extern u8 D_80126C40;
extern u16 D_80126B94;
extern u16 D_80126B96;
extern void func_8012F568(s32 param_1, s32 param_2, s32 param_3, s32 param_4, s32 param_5, s32 param_6);
extern void func_80131B14();
extern void func_80131E00(struct S80131E00 *a0, s32 a1);
extern s32 func_80131A34(s32, s32);
extern void func_80131CA8(int a0, int a1);
extern void func_8012F5F4(s32 arg0);
extern void func_80131C78(s32 a0);
extern void func_8012F68C(s32 arg0);
extern void func_8012F75C(s32 a0);
extern s32 func_8012BEE8(s32);
extern void func_8012F7B4(s32 a0);
extern void func_80131170();
extern void func_80131CA8();
extern unsigned char D_8018D584[];
extern void func_8012F828(int param_1);
extern void func_80131340(s32 a0);
extern void func_8012F87C(s32 a0);
extern void func_80131170(s32 a0, s32 a1, s32 a2);
extern u8 D_8018D590[];
extern void func_8012F8C8(u8* arg0);
extern void func_8012F91C(s32 a0);
extern s32 func_80131A34(s32 a0, s32 a1);
extern void func_80131CA8(s32 a0, s32 a1);
extern void func_8012F968(s32 param_1);
extern void func_801319E0(s32 a0);
extern s32 func_80143B6C(s32 a0, s32 a1);
extern void func_8012FB54(s32 a0);
extern void func_8012FC30(s32 a0);
extern void func_8012FCA4(int a0);
extern s32 func_8012FCC4(s32 param_1);
extern void func_8012FDA8(int param_1);
extern void func_8012FE70(s32 a0);
extern void func_8012FF00(s32 a0);
extern void func_8012FF4C(s32 a0);
extern void func_80130D48(s32 a0);
extern void func_8012FF98(u8 *a0);
extern s32 func_80131AC8(void *a0);
extern void func_8013001C(void *a0);
extern void func_80130088(void *a0);
extern s32 func_8012BCCC(s32);
extern void func_801300F4(s32 a0);
extern void func_801301E8(u8 *a0);
extern void func_80130278(s32 arg0);
extern void func_80130314(s32 a0);
extern void func_80130360(s32 a0);
extern void func_8012E364(void);
extern void func_801303A0(s32 a0);
extern void func_801303EC(void *a0);
extern void func_80143CD4(s32 a0);
extern void func_800CB0E8(s32 a0);
extern void func_80130438(s32 a0);
extern void func_801319E0(int);
extern int func_80131D68(int, int);
extern int func_8012BEE8(int);
extern void func_80131CA8(int, int);
extern void func_80130514(int param_1);
extern void func_801305CC(u8 *a0);
extern void func_8012CBF4(s32);
extern s32 func_80131D68(s32 a0, s32 a1);
extern void func_80130650(s32 a0);
extern s32 func_80146A6C(s32 a0, void *a1, s32 a2, s32 a3, s32 a4, s32 a5, s32 a6);
extern void func_80130740(void *a0, u16 *a1);
extern s32 func_801312D0(s32 a0, void *a1);
extern void func_801307B0(s32 a0);
extern void func_80130858(s32 a0);
extern void func_80130898(u8 *a0);
extern void func_801308DC(s32 a0);
extern void func_80166244();
extern void func_80130974(int param_1);
extern void func_80130A18(u8 *a0);
extern void func_80130AC4(s32 a0);
extern int func_80131A34(int a0, int a1);
extern void func_80130AF0(int param_1);
extern void (*D_8018D5A4[])(void);
extern void func_80130D0C(void *a0);
extern s32 rand(void);
extern u8 D_80078E78[];
extern u16 D_80078EB2;
extern u16 D_80078EB4;
extern s16 D_8018D5F4[];
extern s16 D_8018D624[];
extern s16 D_8018D684[];
extern s16 D_8018D68C[];
extern s16 D_8018D6AC[];
extern void func_80130D48(s32 arg0);
extern void func_80131170(s32 p, s32 b, s32 c);
extern s32 func_801312D0(s32 param_1, void *param_2);
extern void func_80131E00();
extern s32 D_801E5A38;
extern s32 D_801E5A3C;
extern void func_8002A04C(s32 a0);
extern void func_801319E0(s32 arg0);
extern s32 func_80131CF4(s32 a0);
extern int func_80131D68(int a0, int a1);
extern void (*D_8018D6E4[])(struct S80131E00 *a0);
extern void func_80131E38(u8 *a0);
extern void func_80131E7C(s32 a0);
extern void func_80131EE4(void);
extern void (*D_8018D73C[])(void);
extern void func_80131EEC(void *a0);
extern void (*D_8018D784[])(void);
extern void func_80131F28(void *a0);
extern void (*D_8018D78C[])(void);
extern void func_80131F64(void *a0);
extern void (*D_8018D794[])(void);
extern void func_80131FA0(void *a0);
extern void (*D_8018D79C[])(void);
extern void func_80131FDC(void *a0);
extern void func_801320D0(void);
extern void func_8001C214(int, int);
extern int D_8018D744;
extern void func_801320D8(int param_1);
extern s32 func_80132144(s32 param_1);
extern int D_8018D764;
extern void func_801321B0(int param_1);
extern int D_8018D774;
extern void func_8013221C(int param_1);
extern void func_8005C324(int dst, int src, int n) __asm__("memcpy"); /* Phase-24: 0x8005C324 is named memcpy for overlays (whale needs it); keep the non-builtin C name here (else built-in codegen), emit via asm-label */
extern void func_801325B8(int a0, int a1, int a2, int a3, int a4);
extern void func_80132288(int *param_1, int *param_2, int param_3);
extern void func_801325B8(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4);
extern void func_8013240C(s32 a0);
extern void memcpy();
extern void gteMIMefunc();
extern void func_801325B8(int dst, int src, int m0, int mm, int arg5);
extern void func_8013277C(void);
extern void func_80020F34(s32 a0, s32 a1);
extern void func_80054514(s32 a0, s32 a1);
extern void func_80132784(s32 a0, s32 a1, u32 a2);
extern s32 VectorNormalSS(void *a0, void *a1);
extern void func_80132DC4(s32 a0, s32 a1, s32 a2);
extern s32 func_80132E6C(s16 *a0);
extern void func_80132EC4(void *a0, s16 a1);
extern s32 func_80132EF4(s32 a0, s32 a1);
extern void func_801330E0(void * param_1, s16 * param_2, s32 param_3);
extern void func_80133060(u8 *a0, s32 *a1, s32 a2);
extern void func_8013339C(short *param_1, short *param_2);
extern s32 func_8013361C(s16 *a0, s16 *a1, s16 *a2, s16 *a3);
extern s32 D_801E5A80;
extern s32 D_801E5A84[];
extern int D_801E5A88;
extern void func_80136BC4(s32 a0);
extern void func_801336E8(void *a0, int a1, int a2);
extern void func_80136BC4(s32);
extern void func_8013373C(s16 arg0);
extern s32 func_80133784(s32 arg0, void *arg1, s32 arg2);
extern s32 func_80133CD4();
extern s32 func_80134310(Vec3s *a0, Vec3s *a1, s32 a2);
extern s32 func_8013435C(s16 *a0, s16 *a1, s32 a2, s16 *a3);
extern s32 func_801343C4(s32 angle, s32 p1, s32 p2);
extern s32 func_80134510(s32 param);
extern s32 func_801345F8(s32 arg);
extern s32 func_801347A0(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_80134A28(s32 a0, s32 a1, s32 a2);
extern int func_80134A74(int param_1, s16 param_2, s16 param_3, int param_4);
extern s32 func_80134C20(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_80134FB8(s32 a0, s32 a1, s32 a2);
extern s32 func_80135004(s32 arg0, s32 p1, s32 p2);
extern u8 D_8018D7A8;
extern u8 D_8018D7A4;
extern s16 *D_8018D7AC;
extern u8 D_8018D7B0;
extern int D_801E5A80;
extern u16 D_801E5A90;
extern int func_80134A74(int, s16, s16, int);
extern int func_80135168(u16 arg0, u16 *p1, u16 *p2);
extern s16 func_80135480(void *param_1, s32 param_2, s16 *param_3, s16 *param_4);
/* ==== end §8b carried decl layer ==== */
extern s16 func_80135480(void*, s32, s16*, s16*);
extern s32 func_80135EB0(void *arg0, s32 arg1_);
extern int func_80134A74(int, s16, s16, int);
extern s32 func_80136A94(s32 a0, s32 a1, s32 a2, s32 a3);
extern u8 D_8018D7A4;
extern u8 D_8018D7A8;
extern u8 D_8018D7B0;
extern s32 D_801E5A94;
extern s32 D_801E5AB4;
s32 func_80135888(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
s32 pad_[8];
register s32 m __asm__("$2");
s32 sp;
register s32 p1 __asm__("$17");
register s32 mode __asm__("$18");
register s32 p0 __asm__("$19");
register s32 base __asm__("$20");
register s32 p3 __asm__("$21");
p0 = arg0;
p1 = arg1;
p3 = arg3;
switch (((s32 (*)(void *, s32, s16 *, s16 *))func_80135480)((void *)arg0, arg1, (s16 *)arg2, (s16 *)arg3)) {
case 0:
return 0;
case 1:
base = p0 + 0x34;
m = p1 & 0xFFFFFFF;
sp = m | 0x80000000;
mode = 0;
break;
case 2:
base = p0 + 0x34;
m = p1 & 0xFFFFFFF;
sp = m | 0x80000000;
mode = 1;
break;
case 3:
base = p0 + 0x34;
sp = (s32)&D_801E5AB4;
mode = 0;
break;
case 4:
base = (s32)&D_801E5A94;
sp = (s32)&D_801E5AB4;
mode = 1;
break;
}
if (p1 < 0) {
if (func_80135EB0(sp, 0) != 0) {
func_80136A94(mode, p0, p3, base);
return 1;
}
sp = *(s32 *)sp;
__asm__ __volatile__("");
while (sp != 0) {
if (func_80135EB0(sp, 0) != 0) {
hit:
func_80136A94(mode, p0, p3, base);
return 1;
}
sp = *(s32 *)sp;
}
return 0;
}
{
u16 *pb = (*(u16 * *)&D_8018D7A8);
u16 *pa = (*(u16 * *)&D_8018D7A4);
s16 *pc = (*(s16 * *)&D_8018D7B0);
pc[0] = pb[0] - pa[0];
pc[1] = pb[1] - pa[1];
pc[2] = pb[2] - pa[2];
if (func_80134A74(0, (s16)pa[0], (s16)pa[2], sp) == 0) {
return 0;
}
}
goto hit;
}
-732
View File
@@ -1,732 +0,0 @@
#include "common.h"
#include "../shared/engine_core.h"
/* ==== Phase-26 §8b carried decl layer (jr_isolate_all.py) ===================
* The file-scope decl environment from earlier code regions of this object —
* file-local types, col-0 decls, DEFINE_func macro externs, and each earlier
* definition's implied prototype (types first, then decls in original order).
* Decls emit no code => byte-neutral. See cookbook §8c. */
/* 8-byte element, cmd @ +4 */
/* list ptr @ +0x90 */
/* size 8, alignment 1 -> unaligned copy */
extern void func_80128288(void);
extern void func_80128158(void);
extern void func_801285E4(void);
extern void func_80128178(void);
extern void func_80128678(void);
extern void func_80128198(void);
extern void func_80128714(void);
extern void func_801281B8(void);
extern void func_8013E67C(void);
extern void func_801281D8(void);
extern void func_8013E558(void);
extern void func_801281F8(void);
extern s32 D_801E4434;
extern s32 func_80128218(void);
extern void func_80128A28(void);
extern void func_80128228(void);
extern void func_80128AF4(void);
extern void func_80128248(void);
extern void func_801282EC(void);
extern void func_80128268(void);
extern u16 D_800B99F6;
extern void (*D_8018D4AC[])(void);
extern void func_80011B7C(int);
extern void func_801282CC(void);
extern void func_8001C0C8(void);
extern void func_80015310(void);
extern void func_80129258(void);
extern void func_801378F0(void);
extern void func_80010E14(void);
extern s16 currentLocationId;
extern s32 func_80029504(void);
extern s32 func_800CF854(s32);
extern s32 func_80128998(void);
extern s32 func_801289F0(void);
extern s32 func_801288E8(s32);
extern s32 func_80128940(s32);
extern s32 func_80029178(s32);
extern s32 func_801288B0(void);
extern void func_80011C10(void);
extern void func_8012832C(void);
extern void func_80129220(void);
extern void func_80011E24(void);
extern void func_80128C14(void);
extern void func_8002AEF8(void);
extern void func_800CFBBC(void);
extern void SsUtReverbOff(void);
extern void func_8013C98C(void);
extern void func_80129C40(s32 a0);
extern void func_800D0630(void);
extern void func_80145CEC(void);
extern void func_80144B9C(void);
extern u8 D_800B9A17;
extern u8 D_800B9A10;
extern void func_80128420(void);
extern s32 func_800D0588(void);
extern void func_801284B8(void);
extern void func_80175308(void);
extern void func_8016E8F0(void);
extern void func_80175494(void);
extern u8 D_800B9A64;
extern void func_801284F0(void);
extern void func_80146074(void);
extern void func_8012853C(void);
extern void func_80178608(void);
extern void func_8002D4C8(s32 a0, s32 a1);
extern s32 func_80011A3C(void);
extern short currentLocationId;
extern short D_800B99F2;
extern void func_80128564(void);
extern u8 D_800B9A11;
extern void func_801285D4(void);
extern s32 func_800D18DC(void);
extern void func_8014607C(void);
extern void func_801287B8(void);
extern s32 D_801E5A14;
extern void func_80029444(void);
extern void func_800D1754(void);
extern s32 D_80126B58;
extern s32 D_801E7AB8;
extern u16 D_800B99DA;
extern void func_80129CF8(void);
extern void func_8017849C(void);
extern void func_8014FDF4(struct S8014FDF4 *a0);
extern s32 func_801505FC(s32 a0);
extern void func_801508B4(void *a0);
extern void func_80165E90(void);
extern void func_801627E8(void);
extern void func_80162B1C(void);
extern void func_80165CA0(void);
extern void func_80129010(void);
extern void func_8013CA14(void);
extern void func_800190AC(void);
extern void func_8012956C(void);
extern void func_8016E95C(void);
extern void func_801754A8(void);
extern void func_8013BC7C(void);
extern void func_8013BCDC(void);
extern void func_801379FC(void);
extern void func_8001212C(void);
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 sp10);
extern u8 D_800AEFD0;
extern int D_800C7C60;
extern int *D_800C7C64;
extern int D_800A2E20;
extern int D_800AF558;
extern int D_801E4434;
extern int func_801288E8(int arg0);
extern u8 D_800AF560;
extern s32 func_80128940(s32 _arg0);
extern int D_800AECB0;
extern u8 D_800AECB8;
extern void func_8001ABBC(s32 a0, s32 a1, void *a2, s32 a3, s32 a4);
extern s16 D_800B9A00;
extern M2C_UNK (*D_8018D1E0)();
extern s16 (*D_8018D1E4)();
extern M2C_UNK (*D_8018D1EC)();
extern s32 (*D_8018D1F0)();
extern s32 D_801E5A10;
extern void func_80010AE0(s32 a0);
extern void func_80018450(s32 a0, s32 a1);
extern void func_800183E0(s32 a0);
extern void func_80128D60(s32 a0, s32 *a1, s32 *a2);
extern s32 func_80128DB4(s32 a0, s32 *a1);
extern void func_80128EA8(s32 a0, s32 a1, s32 a2);
extern M2C_UNK D_801E4438;
extern void func_80128FAC(u16 *arg0);
extern s16 D_8011DB2C;
extern s16 D_8011DB30;
extern s32 D_80126AEC;
extern u8 *func_8012913C(s32 a0);
extern u8 * func_801290DC(s32 a0, u8 *a1);
extern void func_8001D074(s32 a, s32 b);
extern u8 *func_801291C0(void);
extern s32 func_8001CC3C(s32 a0, s32 a1, s32 a2, s32 a3);
extern u8 * func_8012913C(s32 arg0);
extern void func_80016714(void *a0, s32 a1);
extern u8 * func_801291C0(void);
extern void func_80129248(s16 a0);
extern void func_801292C8(u8 *a0);
extern void func_8012927C(void);
extern void func_8012931C(struct vec *a0);
extern void func_80129350(s32 a0, s32 a1);
extern void func_80129374(s32 a0, s32 a1);
extern s16 D_800B9AAC[];
extern s16 D_800B9AAE[];
extern s16 D_800B9AB0[];
extern s16 D_800B9AB2[];
extern s16 D_800B9AB4[];
extern s16 D_800B9AB6[];
extern s16 D_800B9AB8[];
extern s16 D_800B9ABA[];
extern void func_80129398(void);
extern s16 D_80114EE0;
extern void func_80129428(void);
extern void func_8012943C(void);
extern s32 D_8005128C;
extern u8 D_800B9A78;
extern void func_801298F4(void *arg0);
extern void func_801299C8(s32 a, s32 b, s32 c);
extern void func_8012944C(void);
extern unsigned short D_800B99F0;
extern void func_8012A328(void);
extern void func_80053308(s32);
extern s32 func_80012F74(s32, s32, s32, s32); /* canonical s32 (engine_core); (s16)-cast the return for the sll/sra */
extern void GsSetRefView2L(void *);
extern s8 D_801150D6; /* canonical (engine_core macro): s8 — access via *(u8*)& for lbu */
extern u8 D_80127504;
extern s32 D_80126E60[];
extern s32 D_80126F04[];
extern u8 D_80126948[]; /* canonical (sibling): u8[] — cast (s32*) at use */
extern s32 D_80126FA8[];
extern struct BigCopy D_80126DB8;/* canonical (engine_core macro): struct BigCopy — (s32*)& at use */
extern u8 D_800AF630[]; /* canonical (sibling): u8[] — cast (s32*) at use */
extern s32 D_800AE688[];
extern s32 D_801151D4; /* canonical (10 siblings): scalar s32 — store (s32)ptr */
extern void func_8012A018(s32 a, s32 b);
extern void func_80129FF4(void);
extern u16 D_80126B5E;
extern u16 D_80126B62;
extern u16 D_80126B66;
extern s16 D_80126940;
extern s16 D_80126942;
extern s16 D_80126944;
extern void func_8012A048(void *a0, s32 a1, u8 a2);
extern void *memcpy(void *, const void *, unsigned int);
extern void func_8012A094(s32 a0);
extern void func_8012A100(s8 a0);
extern void func_8012A0E0(void);
extern s8 D_801150D6;
extern s32 D_80120204;
extern s32 D_80120200;
extern s32 D_8012020C;
extern s32 D_80120208;
extern s16 D_80120218;
extern s16 D_80120210;
extern s16 D_8012021A;
extern s16 D_80120212;
extern s16 D_8012021C;
extern s16 D_80120214;
extern s16 D_80120226;
extern s16 D_80120220;
extern s16 D_80120228;
extern s16 D_80120222;
extern s16 D_8012022A;
extern s16 D_80120224;
extern s32 D_80120294;
extern s16 D_80120298;
extern s16 D_8012029A;
extern void func_8012A110(void);
extern s8 D_801152C0;
extern void func_8012A2F4(void);
extern s16 D_80127080;
extern s16 D_801152C2;
extern void func_8012A304(s32 a0, s32 a1);
extern s32 D_801151D4;
extern struct BigCopy D_80126DB8;
extern struct BigCopy D_80114EE8;
extern void func_8012A4BC(void);
extern void func_8012A598(void *a0);
extern void func_8012A568(void (*a0)(void));
extern void func_8012A62C(s32);
extern void func_8012A5F8(void (*a0)(void), s32 a1);
extern void func_8012A62C(s32 a0);
extern void func_8012A7D4(void *a0, void *a1);
extern s32 func_8012A6D0(void *a0, void *a1);
extern s16 func_8012A68C(void);
extern s16 func_8012A79C(s16 *a0, s16 *a1);
extern s16 func_8012A758(void);
extern s32 ratan2(s32 a0, s32 a1);
extern void func_8012A7D4(void *arg0, void *arg1);
extern void func_8012AAAC();
extern void func_8012A828(s32 a0, void * a1);
extern int func_8012ACE0(void *a0);
extern void func_8012A860(void *a0, int a1);
extern void func_8012A8B0(u8 *a0, s32 a1);
extern void func_8012A8E8(void);
extern u8 D_801202A0[];
extern u16 D_801270C0;
extern void func_8012A988(u8 *a0);
extern void func_8012A908(void);
extern s32 func_8012ACE0(void *a0);
extern M2C_UNK D_8018D540;
extern void func_8012ACA0(void *arg0);
extern s32 func_8012ACE0(void *o);
extern void func_8012AD44(s32 *a0, s16 a1);
extern s32 func_8012AD50(void * arg0);
extern void func_8012AD64(s32 *a0, s16 a1);
extern void func_8012AD6C(void *a0);
extern void func_8012AD80(s32 a0);
extern void func_8012ADE4(u8 *a0);
extern s32 *D_80126B78;
extern s32 *D_80126B90;
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
extern s32 func_80013478(s32 a0, s32 a1);
extern s32 func_8012AE00(s32 a0);
extern s32 func_8012AF0C(s32 a0, s32 a1);
extern s32 func_80134510(s32 arg);
extern s32 func_8012B030(u8 *a0);
extern int func_80047948(int a0);
extern int func_8004787C(int a0);
extern void func_8012B0B4(unsigned int *param_1, int param_2, int param_3);
extern void func_800484EC(s32 a0, s32 a1, s32 a2);
extern void func_8012B14C(s32 a0, s32 a1);
extern void func_8012B178(s32 a0, s32 a1);
extern void func_8012B1B4(s32 a0, s32 a1);
extern void func_8012B200(u8 *a0);
extern void func_8012B21C(void *a0);
extern void func_8012B23C(s32 a0);
extern void func_8012B260(u8 *a0);
extern void func_80049CAC(s32 a0, s32 a1);
extern void func_8012B2CC(s32 a0);
extern void RotMatrixYXZ(void *m, void *p);
extern void func_8012B370(int a0);
extern void func_8004978C(s16 *a0, void *a1);
extern void func_8012B414(int a0);
extern s32 func_8012B608(s32 a0, s32 a1, s32 a2);
extern s32 func_8012B6D4(s16 *a0, s16 *a1);
extern s32 func_8012B70C(s16 *a0, s16 *a1);
extern s32 ratan2(s32 x, s32 y);
extern s32 func_8012B744(void *a0, void *a1);
extern s16 D_80126CB8;
extern s16 D_80126CB4;
extern s32 func_8012B864(s32 a0);
extern s32 func_8012B8A4(s16 *a0);
extern s32 func_8012B8E4(s32 arg0, s32 arg1);
extern s32 func_8012BA10(s32 arg0, s32 arg1);
extern s32 func_8012BB3C(s32 arg0, s32 arg1, u32 arg2, s32 arg3);
extern void Square0(s32 *a0, s32 *a1);
extern s32 func_8012BC60(struct Vec *a0, struct Vec *a1);
extern s16 D_80126CBA;
extern s32 func_8012BCCC(s32 a0);
extern void func_80013350(s32 a0, void *a1);
extern u8 D_80126B5C;
extern void func_8012BD14(s32 a0);
extern s32 func_8012BDBC(s32 a0, s32 a1);
extern s32 func_8012BD3C(s32 a0, s32 a1, s32 a2);
extern void func_8012BE98(s32 a0, u16 *a1);
extern void func_8012BE54(s32 a0);
extern s32 func_800132BC(s32 a0, s32 a1);
extern void func_8012BE98(s32 arg0, u16 * arg1);
extern s32 func_8012BEE8(s32 a0);
extern s32 func_8012BF10(s32 a0, s32 a1);
extern void func_8012BF4C(s32 *a0, s32 a1);
extern void func_8012BF54(void *a0);
extern void func_8012BF68(void *a0);
extern s16 D_80126CB0;
extern s32 func_8012BF7C(s16 *a0);
extern s16 D_80126CAC;
extern short D_80126CAE;
extern int func_8012BFA8(short *a0);
extern s32 D_801274D4;
extern s32 D_801274E0;
extern s32 func_8012C044(s32 a0);
extern void func_8012C218(void *a0);
extern void func_8012C098(void *param_1);
extern s32 func_8012C0EC(s32 a0);
extern void func_8012C194(void);
extern void func_8001CFDC(s32 a, s32 b);
extern void func_8012C1B8(void);
extern u8 D_800B3DF0[];
extern s32 func_8012C1DC(s32 a0);
extern u8 D_80126720[];
extern u16 * func_8012C284(u16 *a0);
extern u8 D_80120194[];
extern s32 func_8012C2D0(void);
extern s32 func_8012C31C(void);
extern void func_8012CAE4(void *a0);
extern void func_8001C214(s32 a0, s32 a1);
extern u8 D_80078EAE;
extern s32 func_8012C354(s32 a0, s32 a1);
extern void func_8001C810(s32 a0, s32 a1);
extern s32 func_8012C438(s32 a0, s32 a1);
extern s32 func_8012C890(s32 a0, s32 a1, s32 a2);
extern s32 func_8012C51C(void *a0, s32 a1);
extern s32 func_8012C588(s32 a0, s32 a1);
extern void func_8012C724(s32 a0, s32 a1);
extern s32 func_8012C750(s32 a0);
extern s32 func_8012C820(u8 *a0);
extern s32 D_80190A24;
extern s16 D_801270C4;
extern u16 D_801274E4[];
extern s32 D_8011DB08;
extern s32 func_8012CB64(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
extern s32 func_8012CC88(s32 a, s32 b, s32 c);
extern u8 D_800D3918[];
extern void func_8012CBA4(s32 a0);
extern void func_8012CBCC(s32 a0);
extern void func_8012CBF4(s32 a0);
extern void func_8012CC1C(s32 arg0, s32 arg1);
extern void func_8012CC40(s32 arg0, s32 arg1);
extern s32 func_8012CC88(s32 a0, s32 a1, s32 a2);
extern void func_8012CC64(s32 a0, s32 a1);
extern s32 func_80133784(s32 a0, void *a1, s32 a2);
extern s32 func_8012CE2C(s32 a0);
extern s32 func_8012CEB0(s32 a0, s32 a1, s32 a2);
extern void func_8012CFA8(s32 arg0);
extern void func_8012F214(s32 a0, s32 a1, s32 a2);
extern void func_8012D3B4(s32 arg0, s32 arg1, s32 arg2);
extern void func_8012D098(u16 *param_1, u32 param_2);
extern void func_8012D098();
extern void func_8012D38C(int a0);
extern void func_8012D3AC(void);
extern s32 AddPrim(s32, void *);
extern s32 RotTransPers(s32, s32, s32 *, s32 *);
extern void SetLineF2(void *);
extern void *func_80010A08(s32);
extern void func_8004914C(void *);
extern void func_800491AC(void *);
extern s32 D_800A651C;
extern u8 D_800AF648;
extern s16 D_800B9A02;
extern void func_8012D4B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern void func_8012D5DC(void);
extern s16 D_80126B98;
extern s32 func_8012DEB8(s32 a0, s32 a1, s32 a2);
extern s32 func_8012D5E4(s32 a0, s32 a1, s32 a2, s32 a3);
extern int func_8012D664();
extern void func_8012D624(s32 a0);
extern int func_8012D664(int arg0, int arg1, int arg2);
extern s32 func_8012D714(s32 param_1, u32 param_2);
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
extern void func_8014C978(void);
extern M2C_UNK D_8018D558;
extern M2C_UNK D_8018D560;
extern s32 func_8012DB84(void);
extern s32 func_8012DE2C(s32 a0);
extern s32 func_8012DDA4(void);
extern s32 func_8012DBD0(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_8012DDA4();
extern s32 func_8012DF34(s32 a0, s32 a1, s32 a2);
extern s16 D_80126B9A;
extern u8 D_801152A8[];
extern void func_8012DFBC(void);
extern void func_8012DFCC(void);
extern void func_8012E014(s32 arg0);
extern void func_8012E138(void);
extern void func_8012DFD4(u8 *a0);
extern s32 func_8012E27C(void);
extern void func_8012E284(void);
extern s32 GetTPage(s32, s32, s32, s32);
extern s32 func_8005A600(s32, s32, s32, s32, s32);
extern void func_8012E28C(s32 arg0, s32 arg1);
extern void func_8004914C(void *a0);
extern void func_800491AC(void *a0);
extern void func_8012E32C(void);
extern s32 func_8012E470(s32 a0);
extern void func_8012E4C8(s32 a0);
extern s32 func_8012E504(s32 a0, s32 a1);
extern s32 func_8012E544(s32 a0);
extern s32 func_8012E57C(s32 a0, s32 a1);
extern s32 RotTransPers(s32 a0, s32 a1, s32 *a2, s32 *a3);
extern void func_8012E5CC(s32 param_1, u16 param_2, u16 param_3);
extern void func_8012E688(s32 param_1, u16 param_2, u16 param_3);
extern s32 func_8012E778(int param_1, int param_2);
extern void func_8012E88C(u8 *a0);
extern void func_8012E8A8(u8 *a0);
extern void func_8012E8C4(u8 *a0);
extern void func_8012E8E0(s32 a0, s32 a1);
extern void func_8016AA50(int, int);
extern void func_8016B428(int);
extern void func_80019064(void *);
extern int D_8018D568;
extern void func_8012E9C0(int param_1);
extern void func_8012EA90(s32 param_1, s32 param_2, s32 *param_3);
extern void func_8012EC04(s32 param_1, s32 param_2, s32 *param_3);
extern s32 func_8002A4FC(s32 a0);
extern s32 func_8012EECC(s32 a0);
extern void func_8012EFB8(s32 a0);
extern void func_8012EF34(s32 a0, s32 a1);
extern void func_8012EF70(s32 a0, s32 a1);
extern void ApplyTransposeMatrixLV(void *a0, void *a1, void *a2);
extern void func_8012F038(int param_1, short *param_2, short *param_3);
extern void func_8012F0BC(s32 *a0, s32 *a1, s32 *a2);
extern void RotTransSV(s32 a0, s32 a1, void *a2);
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
extern void func_8012F1A4(s32 *a0, s32 a1, s32 *a2);
extern void func_8012F2E8(s32 a0, s32 a1, s32 a2);
extern s16 D_80126CB6;
extern void func_8012F374(s32 a0, s32 a1);
extern void *memcpy(void *, const void *, u32);
extern u8 D_80126C38;
extern u8 D_80126C40;
extern u16 D_80126B94;
extern u16 D_80126B96;
extern void func_8012F568(s32 param_1, s32 param_2, s32 param_3, s32 param_4, s32 param_5, s32 param_6);
extern void func_80131B14();
extern void func_80131E00(struct S80131E00 *a0, s32 a1);
extern s32 func_80131A34(s32, s32);
extern void func_80131CA8(int a0, int a1);
extern void func_8012F5F4(s32 arg0);
extern void func_80131C78(s32 a0);
extern void func_8012F68C(s32 arg0);
extern void func_8012F75C(s32 a0);
extern s32 func_8012BEE8(s32);
extern void func_8012F7B4(s32 a0);
extern void func_80131170();
extern void func_80131CA8();
extern unsigned char D_8018D584[];
extern void func_8012F828(int param_1);
extern void func_80131340(s32 a0);
extern void func_8012F87C(s32 a0);
extern void func_80131170(s32 a0, s32 a1, s32 a2);
extern u8 D_8018D590[];
extern void func_8012F8C8(u8* arg0);
extern void func_8012F91C(s32 a0);
extern s32 func_80131A34(s32 a0, s32 a1);
extern void func_80131CA8(s32 a0, s32 a1);
extern void func_8012F968(s32 param_1);
extern void func_801319E0(s32 a0);
extern s32 func_80143B6C(s32 a0, s32 a1);
extern void func_8012FB54(s32 a0);
extern void func_8012FC30(s32 a0);
extern void func_8012FCA4(int a0);
extern s32 func_8012FCC4(s32 param_1);
extern void func_8012FDA8(int param_1);
extern void func_8012FE70(s32 a0);
extern void func_8012FF00(s32 a0);
extern void func_8012FF4C(s32 a0);
extern void func_80130D48(s32 a0);
extern void func_8012FF98(u8 *a0);
extern s32 func_80131AC8(void *a0);
extern void func_8013001C(void *a0);
extern void func_80130088(void *a0);
extern s32 func_8012BCCC(s32);
extern void func_801300F4(s32 a0);
extern void func_801301E8(u8 *a0);
extern void func_80130278(s32 arg0);
extern void func_80130314(s32 a0);
extern void func_80130360(s32 a0);
extern void func_8012E364(void);
extern void func_801303A0(s32 a0);
extern void func_801303EC(void *a0);
extern void func_80143CD4(s32 a0);
extern void func_800CB0E8(s32 a0);
extern void func_80130438(s32 a0);
extern void func_801319E0(int);
extern int func_80131D68(int, int);
extern int func_8012BEE8(int);
extern void func_80131CA8(int, int);
extern void func_80130514(int param_1);
extern void func_801305CC(u8 *a0);
extern void func_8012CBF4(s32);
extern s32 func_80131D68(s32 a0, s32 a1);
extern void func_80130650(s32 a0);
extern s32 func_80146A6C(s32 a0, void *a1, s32 a2, s32 a3, s32 a4, s32 a5, s32 a6);
extern void func_80130740(void *a0, u16 *a1);
extern s32 func_801312D0(s32 a0, void *a1);
extern void func_801307B0(s32 a0);
extern void func_80130858(s32 a0);
extern void func_80130898(u8 *a0);
extern void func_801308DC(s32 a0);
extern void func_80166244();
extern void func_80130974(int param_1);
extern void func_80130A18(u8 *a0);
extern void func_80130AC4(s32 a0);
extern int func_80131A34(int a0, int a1);
extern void func_80130AF0(int param_1);
extern void (*D_8018D5A4[])(void);
extern void func_80130D0C(void *a0);
extern s32 rand(void);
extern u8 D_80078E78[];
extern u16 D_80078EB2;
extern u16 D_80078EB4;
extern s16 D_8018D5F4[];
extern s16 D_8018D624[];
extern s16 D_8018D684[];
extern s16 D_8018D68C[];
extern s16 D_8018D6AC[];
extern void func_80130D48(s32 arg0);
extern void func_80131170(s32 p, s32 b, s32 c);
extern s32 func_801312D0(s32 param_1, void *param_2);
extern void func_80131E00();
extern s32 D_801E5A38;
extern s32 D_801E5A3C;
extern void func_8002A04C(s32 a0);
extern void func_801319E0(s32 arg0);
extern s32 func_80131CF4(s32 a0);
extern int func_80131D68(int a0, int a1);
extern void (*D_8018D6E4[])(struct S80131E00 *a0);
extern void func_80131E38(u8 *a0);
extern void func_80131E7C(s32 a0);
extern void func_80131EE4(void);
extern void (*D_8018D73C[])(void);
extern void func_80131EEC(void *a0);
extern void (*D_8018D784[])(void);
extern void func_80131F28(void *a0);
extern void (*D_8018D78C[])(void);
extern void func_80131F64(void *a0);
extern void (*D_8018D794[])(void);
extern void func_80131FA0(void *a0);
extern void (*D_8018D79C[])(void);
extern void func_80131FDC(void *a0);
extern void func_801320D0(void);
extern void func_8001C214(int, int);
extern int D_8018D744;
extern void func_801320D8(int param_1);
extern s32 func_80132144(s32 param_1);
extern int D_8018D764;
extern void func_801321B0(int param_1);
extern int D_8018D774;
extern void func_8013221C(int param_1);
extern void func_8005C324(int dst, int src, int n) __asm__("memcpy"); /* Phase-24: 0x8005C324 is named memcpy for overlays (whale needs it); keep the non-builtin C name here (else built-in codegen), emit via asm-label */
extern void func_801325B8(int a0, int a1, int a2, int a3, int a4);
extern void func_80132288(int *param_1, int *param_2, int param_3);
extern void func_801325B8(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4);
extern void func_8013240C(s32 a0);
extern void memcpy();
extern void gteMIMefunc();
extern void func_801325B8(int dst, int src, int m0, int mm, int arg5);
extern void func_8013277C(void);
extern void func_80020F34(s32 a0, s32 a1);
extern void func_80054514(s32 a0, s32 a1);
extern void func_80132784(s32 a0, s32 a1, u32 a2);
extern s32 VectorNormalSS(void *a0, void *a1);
extern void func_80132DC4(s32 a0, s32 a1, s32 a2);
extern s32 func_80132E6C(s16 *a0);
extern void func_80132EC4(void *a0, s16 a1);
extern s32 func_80132EF4(s32 a0, s32 a1);
extern void func_801330E0(void * param_1, s16 * param_2, s32 param_3);
extern void func_80133060(u8 *a0, s32 *a1, s32 a2);
extern void func_8013339C(short *param_1, short *param_2);
extern s32 func_8013361C(s16 *a0, s16 *a1, s16 *a2, s16 *a3);
extern s32 D_801E5A80;
extern s32 D_801E5A84[];
extern int D_801E5A88;
extern void func_80136BC4(s32 a0);
extern void func_801336E8(void *a0, int a1, int a2);
extern void func_80136BC4(s32);
extern void func_8013373C(s16 arg0);
extern s32 func_80133784(s32 arg0, void *arg1, s32 arg2);
extern s32 func_80133CD4();
extern s32 func_80134310(Vec3s *a0, Vec3s *a1, s32 a2);
extern s32 func_8013435C(s16 *a0, s16 *a1, s32 a2, s16 *a3);
extern s32 func_801343C4(s32 angle, s32 p1, s32 p2);
extern s32 func_80134510(s32 param);
extern s32 func_801345F8(s32 arg);
extern s32 func_801347A0(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_80134A28(s32 a0, s32 a1, s32 a2);
extern int func_80134A74(int param_1, s16 param_2, s16 param_3, int param_4);
extern s32 func_80134C20(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
extern s32 func_80134FB8(s32 a0, s32 a1, s32 a2);
extern s32 func_80135004(s32 arg0, s32 p1, s32 p2);
extern u8 D_8018D7A8;
extern u8 D_8018D7A4;
extern s16 *D_8018D7AC;
extern u8 D_8018D7B0;
extern int D_801E5A80;
extern u16 D_801E5A90;
extern int func_80134A74(int, s16, s16, int);
extern int func_80135168(u16 arg0, u16 *p1, u16 *p2);
extern s16 func_80135480(void *param_1, s32 param_2, s16 *param_3, s16 *param_4);
/* ==== end §8b carried decl layer ==== */
s32 func_80135A4C(s32 a0, s32 a1, s32 *a2, s32 a3) {
typedef struct { s8 c[8]; } Blk8;
extern s16 func_80135480(void *param_1, s32 param_2, s16 *param_3, s16 *param_4);
extern s32 func_80135EB0(void *arg0, s32 arg1_);
extern s32 func_80136A94(s32 a0, s32 a1, s32 a2, s32 a3);
extern s32 func_80133AB0(s16, s16, s16, s32);
extern u8 D_8018D7A4;
extern u8 D_8018D7A8;
extern s16 *D_8018D7AC;
extern s16 D_801E5A8C;
extern u16 D_801E5A90;
extern s32 D_801E5A94;
extern s32 D_801E5AB4;
extern u8 D_801152A8[];
extern u8 D_801152B0;
s32 *p;
register s32 s7 __asm__("$23");
s32 flag;
s32 acc;
s16 i;
s32 eq;
s32 ret;
s32 frame_pad[8];
(void)&frame_pad;
switch (((s32 (*)(void))func_80135480)()) {
case 0:
return 0;
case 1:
s7 = a0 + 0x34;
p = (s32 *)((a1 & 0xFFFFFFF) | 0x80000000);
flag = 0;
break;
case 2:
s7 = a0 + 0x34;
p = (s32 *)((a1 & 0xFFFFFFF) | 0x80000000);
flag = 1;
break;
case 3:
s7 = a0 + 0x34;
p = (s32 *)&D_801E5AB4;
flag = 0;
break;
case 4:
s7 = (s32)&D_801E5A94;
p = (s32 *)&D_801E5AB4;
flag = 1;
break;
}
acc = 0;
if (a1 < 0) {
if (func_80135EB0(p, -0x8000) == 0) {
p = (s32 *)*p;
if (p == 0) return 0;
loop:
if (func_80135EB0(p, -0x8000) == 0) goto next;
}
docall:
func_80136A94(flag, a0, a3, s7);
return 1;
next:
p = (s32 *)*p;
__asm__ __volatile__("");
if (p != 0) goto loop;
return 0;
}
i = 0;
*(s16 *)((*(u8 **)&D_8018D7A4) + 6) = -0x7FFF;
*(s16 *)((*(u8 **)&D_8018D7A8) + 6) = 0x7FFF;
D_801E5A90 = 0;
D_801E5A8C = 0;
{
s32 t = 0;
if (((V3 *)a2)->x == ((V3 *)a3)->x && ((V3 *)a2)->y == ((V3 *)a3)->y) {
s32 zt = (((V3 *)a2)->z == ((V3 *)a3)->z);
__asm__("addu %0,%1,$zero" : "=r"(t) : "r"(zt));
}
eq = t;
}
while (1) {
ret = func_80133AB0(0, (s16)(*(Box **)&D_8018D7A4)->f0, (s16)(*(Box **)&D_8018D7A4)->f4, (s32)p);
if (ret == 0) goto out;
acc |= ret;
if (eq != 0) goto out;
{
s16 old = i;
i = i + 1;
if (old >= 5) return 0;
}
}
out:
if ((s16)acc != 0 || D_801E5A8C != 0) {
if ((*(Box **)&D_8018D7A4)->f6 >= -0xBCB) {
*(Blk8 *)D_801152A8 = *(Blk8 *)&D_801152B0;
}
(*(Box **)&D_8018D7AC)->f0 = (*(Box **)&D_8018D7A8)->f0;
(*(Box **)&D_8018D7AC)->f2 = (*(Box **)&D_8018D7A8)->f2;
(*(Box **)&D_8018D7AC)->f4 = (*(Box **)&D_8018D7A8)->f4;
goto docall;
}
return 0;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-30
View File
@@ -1,30 +0,0 @@
#include "common.h"
#include "../shared/func_80144B9C.h"
/* func_801457A4 @ 0x801457A4 — an -O0 function stranded at the whale's end boundary (it is the
* FIRST fn of the -O2 "after" segment, but its target is -O0: frame-pointer + per-case stack
* reloads). It can only bank in an -O0 object, so it lives here: _o0b is already -O0-compiled and
* its .text ends exactly at 0x801457A4 (right after func_80144B9C), placing this fn at its true
* address with no linker/Makefile change. Its stub was removed from ov_SC01_077_after.c. Def sig
* conformed byte-neutrally to func_80144B9C.h's decl `void *func_801457A4(s32)` (the whale calls it
* that way); byte-proven at -O0 (match_one --o0 79/79) and by the whole-binary gate. Phase-29 bank. */
extern int D_8018CF28;
void *func_801457A4(s32 param_1) {
switch (param_1) {
case 0x1010:
case 0x1052:
case 0x1077:
case 0x1094:
case 0x2013:
case 0x2015 ... 0x201a:
case 0x2055 ... 0x205b:
case 0x207a ... 0x2080:
case 0x2097 ... 0x209d:
return (void *)(&D_8018CF28)[param_1 & 0xffff0fff];
default:
return (void *)D_8018CF28;
break;
}
}
File diff suppressed because it is too large Load Diff
+8 -1
View File
@@ -22,7 +22,14 @@ def carves(tu):
out.append((a, end))
return out
def compiled_tables(tu):
cmd = subprocess.run(['make', '-n', '-W', 'src/%s/%s.c' % (b, tu), 'build/src/%s/%s.o' % (b, tu), 'BINARY=%s' % b], capture_output=True, text=True).stdout
# Phase 35 T3: the TU's source comes from the binary's source dir through the oracle — a twin's objects
# (build/src/<twin>/<twin>_x.o) are compiled from src/<primary>/<primary>_x.c (R33; a hand-built src/<b>/ path
# found no compile line for a twin and raised IndexError here).
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import corpus
prim = corpus.twin_of(b) or b
src = os.path.join(corpus.src_dir(b), tu.replace(b, prim, 1) + '.c')
cmd = subprocess.run(['make', '-n', '-W', src, 'build/src/%s/%s.o' % (b, tu), 'BINARY=%s' % b], capture_output=True, text=True).stdout
line = [l for l in cmd.splitlines() if 'cc1' in l][0]
line = re.sub(r'\|\s*\.venv/bin/python\s+tools/jtbl_rodata_pads\.py[^|]*', '', line)
line = re.sub(r'\|\s*[^|]*mipsel-linux-gnu-as.*$', '', line)